[PATCH 1/3] Move virDomainDefPostParseInternal after virDomainDeviceDefPostParse

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Future commit will call DeviceDefPostParse on a device auto-added
in DomainDefPostParse.
---
 src/conf/domain_conf.c | 78 +++++++++++++++++++++++++-------------------------
 1 file changed, 39 insertions(+), 39 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 571b7bf..13d0f9f 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -3924,45 +3924,6 @@ virDomainDefPostParseTimer(virDomainDefPtr def)
 }
 
 
-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 (virDomainDefRejectDuplicateControllers(def) < 0)
-        return -1;
-
-    if (virDomainDefRejectDuplicatePanics(def) < 0)
-        return -1;
-
-    if (virDomainDefPostParseTimer(def) < 0)
-        return -1;
-
-    if (virDomainDefAddImplicitDevices(def) < 0)
-        return -1;
-
-    /* Mark the first video as primary. If the user specified primary="yes",
-     * the parser already inserted the device at def->videos[0] */
-    if (def->nvideos != 0)
-        def->videos[0]->primary = true;
-
-    /* clean up possibly duplicated metadata entries */
-    virDomainDefMetadataSanitize(def);
-
-    return 0;
-}
-
-
 /* Check if a drive type address $controller:$bus:$target:$unit is already
  * taken by a disk or not.
  */
@@ -4399,6 +4360,45 @@ virDomainDefPostParseDeviceIterator(virDomainDefPtr def ATTRIBUTE_UNUSED,
 }
 
 
+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 (virDomainDefRejectDuplicateControllers(def) < 0)
+        return -1;
+
+    if (virDomainDefRejectDuplicatePanics(def) < 0)
+        return -1;
+
+    if (virDomainDefPostParseTimer(def) < 0)
+        return -1;
+
+    if (virDomainDefAddImplicitDevices(def) < 0)
+        return -1;
+
+    /* Mark the first video as primary. If the user specified primary="yes",
+     * the parser already inserted the device at def->videos[0] */
+    if (def->nvideos != 0)
+        def->videos[0]->primary = true;
+
+    /* clean up possibly duplicated metadata entries */
+    virDomainDefMetadataSanitize(def);
+
+    return 0;
+}
+
+
 int
 virDomainDefPostParse(virDomainDefPtr def,
                       virCapsPtr caps,
-- 
2.7.3

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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]