diff mbox

[02/12] domain: separate out function for post parse timer validation

Message ID efa73c2488a35ab7547bc54ad4e575b0f491a2e7.1452224621.git.crobinso@redhat.com
State Accepted
Commit ee719cdcca61f01a778593dc44aa8fba7a9b4a2c
Headers show

Commit Message

Cole Robinson Jan. 8, 2016, 3:49 a.m. UTC
This should be a no-op
---
 src/conf/domain_conf.c | 53 +++++++++++++++++++++++++++++---------------------
 1 file changed, 31 insertions(+), 22 deletions(-)

-- 
2.5.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
diff mbox

Patch

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index ab22322..2570f94 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -3765,31 +3765,10 @@  virDomainDefAddConsoleCompat(virDomainDefPtr def)
 }
 
 static int
-virDomainDefPostParseInternal(virDomainDefPtr def,
-                              virCapsPtr caps ATTRIBUTE_UNUSED,
-                              unsigned int parseFlags)
+virDomainDefPostParseTimer(virDomainDefPtr def)
 {
     size_t i;
 
-    /* verify init path for container based domains */
-    if (def->os.type == VIR_DOMAIN_OSTYPE_EXE && !def->os.init) {
-        virReportError(VIR_ERR_XML_ERROR, "%s",
-                       _("init binary must be specified"));
-        return -1;
-    }
-
-    if (virDomainDefPostParseMemory(def, parseFlags) < 0)
-        return -1;
-
-    if (virDomainDefAddConsoleCompat(def) < 0)
-        return -1;
-
-    if (virDomainDefRejectDuplicateControllers(def) < 0)
-        return -1;
-
-    if (virDomainDefRejectDuplicatePanics(def) < 0)
-        return -1;
-
     /* verify settings of guest timers */
     for (i = 0; i < def->clock.ntimers; i++) {
         virDomainTimerDefPtr timer = def->clock.timers[i];
@@ -3845,6 +3824,36 @@  virDomainDefPostParseInternal(virDomainDefPtr def,
         }
     }
 
+    return 0;
+}
+
+static int
+virDomainDefPostParseInternal(virDomainDefPtr def,
+                              virCapsPtr caps ATTRIBUTE_UNUSED,
+                              unsigned int parseFlags)
+{
+    /* verify init path for container based domains */
+    if (def->os.type == VIR_DOMAIN_OSTYPE_EXE && !def->os.init) {
+        virReportError(VIR_ERR_XML_ERROR, "%s",
+                       _("init binary must be specified"));
+        return -1;
+    }
+
+    if (virDomainDefPostParseMemory(def, parseFlags) < 0)
+        return -1;
+
+    if (virDomainDefAddConsoleCompat(def) < 0)
+        return -1;
+
+    if (virDomainDefRejectDuplicateControllers(def) < 0)
+        return -1;
+
+    if (virDomainDefRejectDuplicatePanics(def) < 0)
+        return -1;
+
+    if (virDomainDefPostParseTimer(def) < 0)
+        return -1;
+
     /* clean up possibly duplicated metadata entries */
     virDomainDefMetadataSanitize(def);