[PATCH v2 03/11] virDomainDefParse{File, String}: Introduce @parseOpaque argument

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

 



We want to by pass the proper opaque pointer instead of NULL to
virDomainDefParse and subsequently virDomainDefParseNode too.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/bhyve/bhyve_driver.c         |  6 +++---
 src/conf/domain_conf.c           | 11 +++++++----
 src/conf/domain_conf.h           |  2 ++
 src/conf/virdomainobjlist.c      |  2 +-
 src/esx/esx_driver.c             |  4 ++--
 src/libxl/libxl_domain.c         |  2 +-
 src/libxl/libxl_driver.c         |  6 +++---
 src/libxl/libxl_migration.c      |  3 +++
 src/lxc/lxc_driver.c             |  4 ++--
 src/openvz/openvz_driver.c       |  5 +++--
 src/phyp/phyp_driver.c           |  1 +
 src/qemu/qemu_domain.c           |  2 +-
 src/qemu/qemu_driver.c           | 14 +++++++-------
 src/qemu/qemu_migration.c        |  6 +++---
 src/security/virt-aa-helper.c    |  2 +-
 src/test/test_driver.c           |  6 +++---
 src/uml/uml_driver.c             |  4 ++--
 src/vbox/vbox_common.c           |  2 +-
 src/vmware/vmware_driver.c       |  4 ++--
 src/vz/vz_driver.c               |  3 ++-
 src/xen/xen_driver.c             |  5 +++--
 src/xenapi/xenapi_driver.c       |  2 ++
 tests/bhyvexml2argvtest.c        |  2 +-
 tests/domainconftest.c           |  2 +-
 tests/qemuagenttest.c            |  2 +-
 tests/qemuhotplugtest.c          |  1 +
 tests/qemuxml2argvtest.c         |  2 +-
 tests/securityselinuxlabeltest.c |  2 +-
 tests/testutils.c                |  2 +-
 tests/xlconfigtest.c             |  4 ++--
 tests/xmconfigtest.c             |  2 +-
 tests/xml2sexprtest.c            |  2 +-
 tests/xml2vmxtest.c              |  2 +-
 33 files changed, 67 insertions(+), 52 deletions(-)

diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c
index 745e633..51b6301 100644
--- a/src/bhyve/bhyve_driver.c
+++ b/src/bhyve/bhyve_driver.c
@@ -538,7 +538,7 @@ bhyveDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flag
         return NULL;
 
     if ((def = virDomainDefParseString(xml, caps, privconn->xmlopt,
-                                       parse_flags)) == NULL)
+                                       NULL, parse_flags)) == NULL)
         goto cleanup;
 
     if (virDomainDefineXMLFlagsEnsureACL(conn, def) < 0)
@@ -725,7 +725,7 @@ bhyveConnectDomainXMLToNative(virConnectPtr conn,
         goto cleanup;
 
     if (!(def = virDomainDefParseString(xmlData, caps, privconn->xmlopt,
-                                  VIR_DOMAIN_DEF_PARSE_INACTIVE)))
+                                        NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE)))
         goto cleanup;
 
     if (bhyveDomainAssignAddresses(def, NULL) < 0)
@@ -938,7 +938,7 @@ bhyveDomainCreateXML(virConnectPtr conn,
         return NULL;
 
     if ((def = virDomainDefParseString(xml, caps, privconn->xmlopt,
-                                       parse_flags)) == NULL)
+                                       NULL, parse_flags)) == NULL)
         goto cleanup;
 
     if (virDomainCreateXMLEnsureACL(conn, def) < 0)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 430457e..6f5bf2e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -17751,6 +17751,7 @@ virDomainDefParse(const char *xmlStr,
                   const char *filename,
                   virCapsPtr caps,
                   virDomainXMLOptionPtr xmlopt,
+                  void *parseOpaque,
                   unsigned int flags)
 {
     xmlDocPtr xml;
@@ -17759,7 +17760,7 @@ virDomainDefParse(const char *xmlStr,
 
     if ((xml = virXMLParse(filename, xmlStr, _("(domain_definition)")))) {
         def = virDomainDefParseNode(xml, xmlDocGetRootElement(xml), caps,
-                                    xmlopt, NULL, flags);
+                                    xmlopt, parseOpaque, flags);
         xmlFreeDoc(xml);
     }
 
@@ -17771,18 +17772,20 @@ virDomainDefPtr
 virDomainDefParseString(const char *xmlStr,
                         virCapsPtr caps,
                         virDomainXMLOptionPtr xmlopt,
+                        void *parseOpaque,
                         unsigned int flags)
 {
-    return virDomainDefParse(xmlStr, NULL, caps, xmlopt, flags);
+    return virDomainDefParse(xmlStr, NULL, caps, xmlopt, parseOpaque, flags);
 }
 
 virDomainDefPtr
 virDomainDefParseFile(const char *filename,
                       virCapsPtr caps,
                       virDomainXMLOptionPtr xmlopt,
+                      void *parseOpaque,
                       unsigned int flags)
 {
-    return virDomainDefParse(NULL, filename, caps, xmlopt, flags);
+    return virDomainDefParse(NULL, filename, caps, xmlopt, parseOpaque, flags);
 }
 
 
@@ -24673,7 +24676,7 @@ virDomainDefCopy(virDomainDefPtr src,
     if (!(xml = virDomainDefFormat(src, caps, format_flags)))
         return NULL;
 
-    ret = virDomainDefParseString(xml, caps, xmlopt, parse_flags);
+    ret = virDomainDefParseString(xml, caps, xmlopt, NULL, parse_flags);
 
     VIR_FREE(xml);
     return ret;
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index ed44bc4..30ab1a5 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2675,10 +2675,12 @@ virStorageSourcePtr virDomainDiskDefSourceParse(const char *xmlStr,
 virDomainDefPtr virDomainDefParseString(const char *xmlStr,
                                         virCapsPtr caps,
                                         virDomainXMLOptionPtr xmlopt,
+                                        void *parseOpaque,
                                         unsigned int flags);
 virDomainDefPtr virDomainDefParseFile(const char *filename,
                                       virCapsPtr caps,
                                       virDomainXMLOptionPtr xmlopt,
+                                      void *parseOpaque,
                                       unsigned int flags);
 virDomainDefPtr virDomainDefParseNode(xmlDocPtr doc,
                                       xmlNodePtr root,
diff --git a/src/conf/virdomainobjlist.c b/src/conf/virdomainobjlist.c
index 41c9910..8d425d6 100644
--- a/src/conf/virdomainobjlist.c
+++ b/src/conf/virdomainobjlist.c
@@ -462,7 +462,7 @@ virDomainObjListLoadConfig(virDomainObjListPtr doms,
 
     if ((configFile = virDomainConfigFile(configDir, name)) == NULL)
         goto error;
-    if (!(def = virDomainDefParseFile(configFile, caps, xmlopt,
+    if (!(def = virDomainDefParseFile(configFile, caps, xmlopt, NULL,
                                       VIR_DOMAIN_DEF_PARSE_INACTIVE |
                                       VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS |
                                       VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
diff --git a/src/esx/esx_driver.c b/src/esx/esx_driver.c
index 5ce98b3..17ef00f 100644
--- a/src/esx/esx_driver.c
+++ b/src/esx/esx_driver.c
@@ -2831,7 +2831,7 @@ esxConnectDomainXMLToNative(virConnectPtr conn, const char *nativeFormat,
         return NULL;
 
     def = virDomainDefParseString(domainXml, priv->caps, priv->xmlopt,
-                                  VIR_DOMAIN_DEF_PARSE_INACTIVE);
+                                  NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE);
 
     if (!def)
         return NULL;
@@ -3046,7 +3046,7 @@ esxDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags)
 
     /* Parse domain XML */
     def = virDomainDefParseString(xml, priv->caps, priv->xmlopt,
-                                  parse_flags);
+                                  NULL, parse_flags);
 
     if (!def)
         return NULL;
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index a53b977..50385fd 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -677,7 +677,7 @@ libxlDomainSaveImageOpen(libxlDriverPrivatePtr driver,
         goto error;
     }
 
-    if (!(def = virDomainDefParseString(xml, cfg->caps, driver->xmlopt,
+    if (!(def = virDomainDefParseString(xml, cfg->caps, driver->xmlopt, NULL,
                                         VIR_DOMAIN_DEF_PARSE_INACTIVE |
                                         VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
         goto error;
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 42fa129..54eee55 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -1027,7 +1027,7 @@ libxlDomainCreateXML(virConnectPtr conn, const char *xml,
         parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
 
     if (!(def = virDomainDefParseString(xml, cfg->caps, driver->xmlopt,
-                                        parse_flags)))
+                                        NULL, parse_flags)))
         goto cleanup;
 
     if (virDomainCreateXMLEnsureACL(conn, def) < 0)
@@ -2655,7 +2655,7 @@ libxlConnectDomainXMLToNative(virConnectPtr conn, const char * nativeFormat,
         goto cleanup;
 
     if (!(def = virDomainDefParseString(domainXml,
-                                        cfg->caps, driver->xmlopt,
+                                        cfg->caps, driver->xmlopt, NULL,
                                         VIR_DOMAIN_DEF_PARSE_INACTIVE)))
         goto cleanup;
 
@@ -2781,7 +2781,7 @@ libxlDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flag
         parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
 
     if (!(def = virDomainDefParseString(xml, cfg->caps, driver->xmlopt,
-                                        parse_flags)))
+                                        NULL, parse_flags)))
         goto cleanup;
 
     if (virDomainDefineXMLFlagsEnsureACL(conn, def) < 0)
diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c
index 3b0dc74..534abb8 100644
--- a/src/libxl/libxl_migration.c
+++ b/src/libxl/libxl_migration.c
@@ -419,6 +419,7 @@ libxlDomainMigrationBegin(virConnectPtr conn,
     if (xmlin) {
         if (!(tmpdef = virDomainDefParseString(xmlin, cfg->caps,
                                                driver->xmlopt,
+                                               NULL,
                                                VIR_DOMAIN_DEF_PARSE_INACTIVE |
                                                VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
             goto endjob;
@@ -463,6 +464,7 @@ libxlDomainMigrationPrepareDef(libxlDriverPrivatePtr driver,
     }
 
     if (!(def = virDomainDefParseString(dom_xml, cfg->caps, driver->xmlopt,
+                                        NULL,
                                         VIR_DOMAIN_DEF_PARSE_INACTIVE |
                                         VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
         goto cleanup;
@@ -544,6 +546,7 @@ libxlDomainMigrationPrepare(virConnectPtr dconn,
 
                 VIR_DEBUG("Using hook-filtered domain XML: %s", xmlout);
                 newdef = virDomainDefParseString(xmlout, cfg->caps, driver->xmlopt,
+                                                 NULL,
                                                  VIR_DOMAIN_DEF_PARSE_INACTIVE |
                                                  VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
                 if (!newdef)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 24025d1..a9e664c 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -472,7 +472,7 @@ lxcDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags)
         goto cleanup;
 
     if (!(def = virDomainDefParseString(xml, caps, driver->xmlopt,
-                                        parse_flags)))
+                                        NULL, parse_flags)))
         goto cleanup;
 
     if (virDomainDefineXMLFlagsEnsureACL(conn, def) < 0)
@@ -1225,7 +1225,7 @@ lxcDomainCreateXMLWithFiles(virConnectPtr conn,
         goto cleanup;
 
     if (!(def = virDomainDefParseString(xml, caps, driver->xmlopt,
-                                        parse_flags)))
+                                        NULL, parse_flags)))
         goto cleanup;
 
     if (virDomainCreateXMLWithFilesEnsureACL(conn, def) < 0)
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index e1c008c..376c741 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -996,7 +996,7 @@ openvzDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int fla
 
     openvzDriverLock(driver);
     if ((vmdef = virDomainDefParseString(xml, driver->caps, driver->xmlopt,
-                                         parse_flags)) == NULL)
+                                         NULL, parse_flags)) == NULL)
         goto cleanup;
 
     if (!(vm = virDomainObjListAdd(driver->domains, vmdef,
@@ -1086,7 +1086,7 @@ openvzDomainCreateXML(virConnectPtr conn, const char *xml,
 
     openvzDriverLock(driver);
     if ((vmdef = virDomainDefParseString(xml, driver->caps, driver->xmlopt,
-                                         parse_flags)) == NULL)
+                                         NULL, parse_flags)) == NULL)
         goto cleanup;
 
     if (!(vm = virDomainObjListAdd(driver->domains,
@@ -2317,6 +2317,7 @@ openvzDomainMigratePrepare3Params(virConnectPtr dconn,
     }
 
     if (!(def = virDomainDefParseString(dom_xml, driver->caps, driver->xmlopt,
+                                        NULL,
                                         VIR_DOMAIN_DEF_PARSE_INACTIVE |
                                         VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
         goto error;
diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index 2c1a854..b62a2c4 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -3576,6 +3576,7 @@ phypDomainCreateXML(virConnectPtr conn,
 
     if (!(def = virDomainDefParseString(xml, phyp_driver->caps,
                                         phyp_driver->xmlopt,
+                                        NULL,
                                         parse_flags)))
         goto err;
 
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index b33e018..9f67eaf 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3364,7 +3364,7 @@ qemuDomainDefCopy(virQEMUDriverPtr driver,
     if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
         goto cleanup;
 
-    if (!(ret = virDomainDefParseString(xml, caps, driver->xmlopt,
+    if (!(ret = virDomainDefParseString(xml, caps, driver->xmlopt, NULL,
                                         VIR_DOMAIN_DEF_PARSE_INACTIVE |
                                         VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
         goto cleanup;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 50d62bb..4ed12bb 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -1751,7 +1751,7 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn,
         goto cleanup;
 
     if (!(def = virDomainDefParseString(xml, caps, driver->xmlopt,
-                                        parse_flags)))
+                                        NULL, parse_flags)))
         goto cleanup;
 
     if (virDomainCreateXMLEnsureACL(conn, def) < 0)
@@ -3192,7 +3192,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom,
     if (xmlin) {
         virDomainDefPtr def = NULL;
 
-        if (!(def = virDomainDefParseString(xmlin, caps, driver->xmlopt,
+        if (!(def = virDomainDefParseString(xmlin, caps, driver->xmlopt, NULL,
                                             VIR_DOMAIN_DEF_PARSE_INACTIVE |
                                             VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE))) {
             goto endjob;
@@ -6303,7 +6303,7 @@ qemuDomainSaveImageUpdateDef(virQEMUDriverPtr driver,
     if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
         goto cleanup;
 
-    if (!(newdef = virDomainDefParseString(newxml, caps, driver->xmlopt,
+    if (!(newdef = virDomainDefParseString(newxml, caps, driver->xmlopt, NULL,
                                            VIR_DOMAIN_DEF_PARSE_INACTIVE)))
         goto cleanup;
 
@@ -6459,7 +6459,7 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
     }
 
     /* Create a domain from this XML */
-    if (!(def = virDomainDefParseString(xml, caps, driver->xmlopt,
+    if (!(def = virDomainDefParseString(xml, caps, driver->xmlopt, NULL,
                                         VIR_DOMAIN_DEF_PARSE_INACTIVE |
                                         VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
         goto error;
@@ -7011,7 +7011,7 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
     if (!(vm = virDomainObjNew(driver->xmlopt)))
         goto cleanup;
 
-    if (!(vm->def = virDomainDefParseString(xmlData, caps, driver->xmlopt,
+    if (!(vm->def = virDomainDefParseString(xmlData, caps, driver->xmlopt, NULL,
                                             VIR_DOMAIN_DEF_PARSE_INACTIVE |
                                             VIR_DOMAIN_DEF_PARSE_ABI_UPDATE)))
         goto cleanup;
@@ -7249,7 +7249,7 @@ qemuDomainDefineXMLFlags(virConnectPtr conn,
         goto cleanup;
 
     if (!(def = virDomainDefParseString(xml, caps, driver->xmlopt,
-                                        parse_flags)))
+                                        NULL, parse_flags)))
         goto cleanup;
 
     if (virDomainDefineXMLFlagsEnsureACL(conn, def) < 0)
@@ -14603,7 +14603,7 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
         /* Easiest way to clone inactive portion of vm->def is via
          * conversion in and back out of xml.  */
         if (!(xml = qemuDomainDefFormatLive(driver, vm->def, true, true)) ||
-            !(def->dom = virDomainDefParseString(xml, caps, driver->xmlopt,
+            !(def->dom = virDomainDefParseString(xml, caps, driver->xmlopt, NULL,
                                                  VIR_DOMAIN_DEF_PARSE_INACTIVE |
                                                  VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
             goto endjob;
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index fc73534..df48eab 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -3242,7 +3242,7 @@ qemuMigrationBeginPhase(virQEMUDriverPtr driver,
     }
 
     if (xmlin) {
-        if (!(def = virDomainDefParseString(xmlin, caps, driver->xmlopt,
+        if (!(def = virDomainDefParseString(xmlin, caps, driver->xmlopt, NULL,
                                             VIR_DOMAIN_DEF_PARSE_INACTIVE |
                                             VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
             goto cleanup;
@@ -3664,7 +3664,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
                 virDomainDefPtr newdef;
 
                 VIR_DEBUG("Using hook-filtered domain XML: %s", xmlout);
-                newdef = virDomainDefParseString(xmlout, caps, driver->xmlopt,
+                newdef = virDomainDefParseString(xmlout, caps, driver->xmlopt, NULL,
                                                  VIR_DOMAIN_DEF_PARSE_INACTIVE |
                                                  VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
                 if (!newdef)
@@ -4144,7 +4144,7 @@ qemuMigrationPrepareDef(virQEMUDriverPtr driver,
     if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
         return NULL;
 
-    if (!(def = virDomainDefParseString(dom_xml, caps, driver->xmlopt,
+    if (!(def = virDomainDefParseString(dom_xml, caps, driver->xmlopt, NULL,
                                         VIR_DOMAIN_DEF_PARSE_INACTIVE |
                                         VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
         goto cleanup;
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index fc01076..28ee5ac 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -704,7 +704,7 @@ get_definition(vahControl * ctl, const char *xmlStr)
     }
 
     ctl->def = virDomainDefParseString(xmlStr,
-                                       ctl->caps, ctl->xmlopt,
+                                       ctl->caps, ctl->xmlopt, NULL,
                                        VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
 
     if (ctl->def == NULL) {
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 054bb2e..bf5c1b0 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -1609,7 +1609,7 @@ testDomainCreateXML(virConnectPtr conn, const char *xml,
 
     testDriverLock(privconn);
     if ((def = virDomainDefParseString(xml, privconn->caps, privconn->xmlopt,
-                                       parse_flags)) == NULL)
+                                       NULL, parse_flags)) == NULL)
         goto cleanup;
 
     if (testDomainGenerateIfnames(def) < 0)
@@ -2118,7 +2118,7 @@ testDomainRestoreFlags(virConnectPtr conn,
     xml[len] = '\0';
 
     def = virDomainDefParseString(xml, privconn->caps, privconn->xmlopt,
-                                  VIR_DOMAIN_DEF_PARSE_INACTIVE);
+                                  NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE);
     if (!def)
         goto cleanup;
 
@@ -2615,7 +2615,7 @@ static virDomainPtr testDomainDefineXMLFlags(virConnectPtr conn,
         parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
 
     if ((def = virDomainDefParseString(xml, privconn->caps, privconn->xmlopt,
-                                       parse_flags)) == NULL)
+                                       NULL, parse_flags)) == NULL)
         goto cleanup;
 
     if (testDomainGenerateIfnames(def) < 0)
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
index 90d2eae..7c0ebba 100644
--- a/src/uml/uml_driver.c
+++ b/src/uml/uml_driver.c
@@ -1589,7 +1589,7 @@ static virDomainPtr umlDomainCreateXML(virConnectPtr conn, const char *xml,
     virNWFilterReadLockFilterUpdates();
     umlDriverLock(driver);
     if (!(def = virDomainDefParseString(xml, driver->caps, driver->xmlopt,
-                                        parse_flags)))
+                                        NULL, parse_flags)))
         goto cleanup;
 
     if (virDomainCreateXMLEnsureACL(conn, def) < 0)
@@ -2070,7 +2070,7 @@ umlDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags)
 
     umlDriverLock(driver);
     if (!(def = virDomainDefParseString(xml, driver->caps, driver->xmlopt,
-                                        parse_flags)))
+                                        NULL, parse_flags)))
         goto cleanup;
 
     if (virDomainDefineXMLFlagsEnsureACL(conn, def) < 0)
diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
index dfade01..b46be4b 100644
--- a/src/vbox/vbox_common.c
+++ b/src/vbox/vbox_common.c
@@ -1874,7 +1874,7 @@ vboxDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags
 
     VBOX_IID_INITIALIZE(&mchiid);
     if (!(def = virDomainDefParseString(xml, data->caps, data->xmlopt,
-                                        parse_flags))) {
+                                        NULL, parse_flags))) {
         goto cleanup;
     }
 
diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c
index d44b8a3..b0cc47b 100644
--- a/src/vmware/vmware_driver.c
+++ b/src/vmware/vmware_driver.c
@@ -388,7 +388,7 @@ vmwareDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int fla
 
     vmwareDriverLock(driver);
     if ((vmdef = virDomainDefParseString(xml, driver->caps, driver->xmlopt,
-                                         parse_flags)) == NULL)
+                                         NULL, parse_flags)) == NULL)
         goto cleanup;
 
     /* generate vmx file */
@@ -682,7 +682,7 @@ vmwareDomainCreateXML(virConnectPtr conn, const char *xml,
     vmwareDriverLock(driver);
 
     if ((vmdef = virDomainDefParseString(xml, driver->caps, driver->xmlopt,
-                                         parse_flags)) == NULL)
+                                         NULL, parse_flags)) == NULL)
         goto cleanup;
 
     /* generate vmx file */
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
index 2f2be122..f3f5eac 100644
--- a/src/vz/vz_driver.c
+++ b/src/vz/vz_driver.c
@@ -850,7 +850,7 @@ vzDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags)
         parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
 
     if ((def = virDomainDefParseString(xml, driver->caps, driver->xmlopt,
-                                       parse_flags)) == NULL)
+                                       NULL, parse_flags)) == NULL)
         goto cleanup;
 
     if (virDomainDefineXMLFlagsEnsureACL(conn, def) < 0)
@@ -3046,6 +3046,7 @@ vzDomainMigratePrepare3Params(virConnectPtr conn,
         goto cleanup;
 
     if (!(def = virDomainDefParseString(dom_xml, driver->caps, driver->xmlopt,
+                                        NULL,
                                         VIR_DOMAIN_DEF_PARSE_INACTIVE)))
         goto cleanup;
 
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index 5c38bdf..ed3acf7 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -765,7 +765,7 @@ xenUnifiedDomainCreateXML(virConnectPtr conn,
         parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
 
     if (!(def = virDomainDefParseString(xml, priv->caps, priv->xmlopt,
-                                        parse_flags)))
+                                        NULL, parse_flags)))
         goto cleanup;
 
     if (virDomainCreateXMLEnsureACL(conn, def) < 0)
@@ -1617,6 +1617,7 @@ xenUnifiedConnectDomainXMLToNative(virConnectPtr conn,
     }
 
     if (!(def = virDomainDefParseString(xmlData, priv->caps, priv->xmlopt,
+                                        NULL,
                                         VIR_DOMAIN_DEF_PARSE_INACTIVE)))
         goto cleanup;
 
@@ -1805,7 +1806,7 @@ xenUnifiedDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int
         parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
 
     if (!(def = virDomainDefParseString(xml, priv->caps, priv->xmlopt,
-                                        parse_flags)))
+                                        NULL, parse_flags)))
         goto cleanup;
 
     if (virDomainDefineXMLFlagsEnsureACL(conn, def) < 0)
diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c
index a58c10e..9ec083f 100644
--- a/src/xenapi/xenapi_driver.c
+++ b/src/xenapi/xenapi_driver.c
@@ -568,6 +568,7 @@ xenapiDomainCreateXML(virConnectPtr conn,
 
     virDomainDefPtr defPtr = virDomainDefParseString(xmlDesc,
                                                      priv->caps, priv->xmlopt,
+                                                     NULL,
                                                      parse_flags);
     if (!defPtr)
         return NULL;
@@ -1752,6 +1753,7 @@ xenapiDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int fla
         return NULL;
     virDomainDefPtr defPtr = virDomainDefParseString(xml,
                                                      priv->caps, priv->xmlopt,
+                                                     NULL,
                                                      parse_flags);
     if (!defPtr)
         return NULL;
diff --git a/tests/bhyvexml2argvtest.c b/tests/bhyvexml2argvtest.c
index 7a2d366..b85439b 100644
--- a/tests/bhyvexml2argvtest.c
+++ b/tests/bhyvexml2argvtest.c
@@ -35,7 +35,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
         goto out;
 
     if (!(vmdef = virDomainDefParseFile(xml, driver.caps, driver.xmlopt,
-                                        VIR_DOMAIN_DEF_PARSE_INACTIVE))) {
+                                        NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE))) {
         if (flags & FLAG_EXPECT_PARSE_ERROR)
             ret = 0;
         goto out;
diff --git a/tests/domainconftest.c b/tests/domainconftest.c
index 7d119bb..196e358 100644
--- a/tests/domainconftest.c
+++ b/tests/domainconftest.c
@@ -52,7 +52,7 @@ static int testGetFilesystem(const void *opaque)
                     abs_srcdir, data->filename) < 0)
         goto cleanup;
 
-    if (!(def = virDomainDefParseFile(filename, caps, xmlopt, 0)))
+    if (!(def = virDomainDefParseFile(filename, caps, xmlopt, NULL, 0)))
         goto cleanup;
 
     fsdef = virDomainGetFilesystemForTarget(def,
diff --git a/tests/qemuagenttest.c b/tests/qemuagenttest.c
index 4aa2c49..5dfa58e 100644
--- a/tests/qemuagenttest.c
+++ b/tests/qemuagenttest.c
@@ -182,7 +182,7 @@ testQemuAgentGetFSInfo(const void *data)
         goto cleanup;
 
     if (!(def = virDomainDefParseFile(domain_filename, caps, xmlopt,
-                                      VIR_DOMAIN_DEF_PARSE_INACTIVE)))
+                                      NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE)))
         goto cleanup;
 
     if (qemuMonitorTestAddAgentSyncResponse(test) < 0)
diff --git a/tests/qemuhotplugtest.c b/tests/qemuhotplugtest.c
index 6a9ed99..43eb1cf 100644
--- a/tests/qemuhotplugtest.c
+++ b/tests/qemuhotplugtest.c
@@ -84,6 +84,7 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt,
     if (!((*vm)->def = virDomainDefParseString(domxml,
                                                driver.caps,
                                                driver.xmlopt,
+                                               NULL,
                                                VIR_DOMAIN_DEF_PARSE_INACTIVE)))
         goto cleanup;
 
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
index 7080484..0af71a1 100644
--- a/tests/qemuxml2argvtest.c
+++ b/tests/qemuxml2argvtest.c
@@ -424,7 +424,7 @@ testCompareXMLToArgv(const void *data)
 
     parseFlags |= VIR_DOMAIN_DEF_PARSE_INACTIVE;
     if (!(vm->def = virDomainDefParseFile(xml, driver.caps, driver.xmlopt,
-                                          parseFlags))) {
+                                          NULL, parseFlags))) {
         if (flags & FLAG_EXPECT_PARSE_ERROR)
             goto ok;
         goto cleanup;
diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabeltest.c
index 4c0f427..e98d9bb 100644
--- a/tests/securityselinuxlabeltest.c
+++ b/tests/securityselinuxlabeltest.c
@@ -189,7 +189,7 @@ testSELinuxLoadDef(const char *testname)
                     abs_srcdir, testname) < 0)
         goto cleanup;
 
-    if (!(def = virDomainDefParseFile(xmlfile, caps, driver.xmlopt, 0)))
+    if (!(def = virDomainDefParseFile(xmlfile, caps, driver.xmlopt, NULL, 0)))
         goto cleanup;
 
     for (i = 0; i < def->ndisks; i++) {
diff --git a/tests/testutils.c b/tests/testutils.c
index c934785..35b041f 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -1127,7 +1127,7 @@ testCompareDomXML2XMLFiles(virCapsPtr caps, virDomainXMLOptionPtr xmlopt,
     if (!live)
         format_flags |= VIR_DOMAIN_DEF_FORMAT_INACTIVE;
 
-    if (!(def = virDomainDefParseFile(infile, caps, xmlopt, parse_flags))) {
+    if (!(def = virDomainDefParseFile(infile, caps, xmlopt, NULL, parse_flags))) {
         result = TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE;
         goto out;
     }
diff --git a/tests/xlconfigtest.c b/tests/xlconfigtest.c
index 61a6295..d99f887 100644
--- a/tests/xlconfigtest.c
+++ b/tests/xlconfigtest.c
@@ -89,11 +89,11 @@ testCompareParseXML(const char *xlcfg, const char *xml, bool replaceVars)
         if (!(replacedXML = testReplaceVarsXML(xml)))
             goto fail;
         if (!(def = virDomainDefParseString(replacedXML, caps, xmlopt,
-                                            VIR_DOMAIN_XML_INACTIVE)))
+                                            NULL, VIR_DOMAIN_XML_INACTIVE)))
             goto fail;
     } else {
         if (!(def = virDomainDefParseFile(xml, caps, xmlopt,
-                                          VIR_DOMAIN_XML_INACTIVE)))
+                                          NULL, VIR_DOMAIN_XML_INACTIVE)))
             goto fail;
     }
 
diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c
index 96990ee..6399777 100644
--- a/tests/xmconfigtest.c
+++ b/tests/xmconfigtest.c
@@ -63,7 +63,7 @@ testCompareParseXML(const char *xmcfg, const char *xml)
     priv.caps = caps;
     conn->privateData = &priv;
 
-    if (!(def = virDomainDefParseFile(xml, caps, xmlopt,
+    if (!(def = virDomainDefParseFile(xml, caps, xmlopt, NULL,
                                       VIR_DOMAIN_DEF_PARSE_INACTIVE)))
         goto fail;
 
diff --git a/tests/xml2sexprtest.c b/tests/xml2sexprtest.c
index 77fea4a..0b95113 100644
--- a/tests/xml2sexprtest.c
+++ b/tests/xml2sexprtest.c
@@ -27,7 +27,7 @@ testCompareFiles(const char *xml, const char *sexpr)
   int ret = -1;
   virDomainDefPtr def = NULL;
 
-  if (!(def = virDomainDefParseFile(xml, caps, xmlopt,
+  if (!(def = virDomainDefParseFile(xml, caps, xmlopt, NULL,
                                     VIR_DOMAIN_DEF_PARSE_INACTIVE)))
       goto fail;
 
diff --git a/tests/xml2vmxtest.c b/tests/xml2vmxtest.c
index bf66152..b77be89 100644
--- a/tests/xml2vmxtest.c
+++ b/tests/xml2vmxtest.c
@@ -76,7 +76,7 @@ testCompareFiles(const char *xml, const char *vmx, int virtualHW_version)
     char *formatted = NULL;
     virDomainDefPtr def = NULL;
 
-    def = virDomainDefParseFile(xml, caps, xmlopt,
+    def = virDomainDefParseFile(xml, caps, xmlopt, NULL,
                                 VIR_DOMAIN_DEF_PARSE_INACTIVE);
 
     if (def == NULL)
-- 
2.8.4

--
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]