[PATCH v1 50/51] util: conf: separate virDomainDefParseNameSpaceInfo from virDomainDefParseXML

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

 



separate virDomainDefParseNameSpaceInfo from virDomainDefParseXML
---
 src/conf/domain_conf.c | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 7006e7f..7caff3a 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -21045,6 +21045,25 @@ virDomainDefParseMetadataInfo(virDomainParseTotalParamPtr param)
     return 0;
 }
 
+
+static int
+virDomainDefParseNameSpaceInfo(virDomainParseTotalParamPtr param)
+{
+    /* we have to make a copy of all of the callback pointers here since
+     * we won't have the virCaps structure available during free
+     */
+    param->def->ns = param->xmlopt->ns;
+
+    if (param->def->ns.parse &&
+        (param->def->ns.parse)(param->xml,
+                        param->root,
+                        param->ctxt,
+                        &param->def->namespaceData) < 0)
+        return -1;
+
+    return 0;
+}
+
 static virDomainDefPtr
 virDomainDefParseXML(xmlDocPtr xml,
                      xmlNodePtr root,
@@ -21100,6 +21119,7 @@ virDomainDefParseXML(xmlDocPtr xml,
             virDomainDefParseSysinfoInfo,
             virDomainDefParseKeyWrapInfo,
             virDomainDefParseMetadataInfo,
+            virDomainDefParseNameSpaceInfo,
             NULL
     };
 
@@ -21131,15 +21151,6 @@ virDomainDefParseXML(xmlDocPtr xml,
         fun_index++;
     }
 
-    /* we have to make a copy of all of the callback pointers here since
-     * we won't have the virCaps structure available during free
-     */
-    def->ns = xmlopt->ns;
-
-    if (def->ns.parse &&
-        (def->ns.parse)(xml, root, ctxt, &def->namespaceData) < 0)
-        goto error;
-
     /* callback to fill driver specific domain aspects */
     if (virDomainDefPostParseInternal(def, caps, flags, xmlopt, parseOpaque,
                                       bootHash) < 0)
-- 
2.8.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]

  Powered by Linux