render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
3e5111
From c6dcdb3a528ca4fb8f06118a28b53ab7d174d26a Mon Sep 17 00:00:00 2001
3e5111
Message-Id: <c6dcdb3a528ca4fb8f06118a28b53ab7d174d26a@dist-git>
3e5111
From: Michal Privoznik <mprivozn@redhat.com>
3e5111
Date: Mon, 5 Jun 2017 09:35:23 +0200
3e5111
Subject: [PATCH] virDomainXMLOption: Introduce virDomainABIStabilityDomain
3e5111
3e5111
https://bugzilla.redhat.com/show_bug.cgi?id=1450349
3e5111
3e5111
While checking for ABI stability, drivers might pose additional
3e5111
checks that are not valid for general case. For instance, qemu
3e5111
driver might check some memory backing attributes because of how
3e5111
qemu works. But those attributes may work well in other drivers.
3e5111
3e5111
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
3e5111
(cherry picked from commit 4f0aeed8713b679dd024542f4823efcef1473f4f)
3e5111
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
3e5111
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
3e5111
---
3e5111
 src/bhyve/bhyve_domain.c      |  2 +-
3e5111
 src/conf/domain_conf.c        | 19 ++++++++++++++++---
3e5111
 src/conf/domain_conf.h        | 16 ++++++++++++++--
3e5111
 src/conf/snapshot_conf.c      |  3 ++-
3e5111
 src/conf/snapshot_conf.h      |  1 +
3e5111
 src/libxl/libxl_conf.c        |  2 +-
3e5111
 src/libxl/libxl_domain.c      |  4 +++-
3e5111
 src/lxc/lxc_conf.c            |  3 ++-
3e5111
 src/openvz/openvz_driver.c    |  2 +-
3e5111
 src/phyp/phyp_driver.c        |  2 +-
3e5111
 src/qemu/qemu_capabilities.c  |  2 +-
3e5111
 src/qemu/qemu_conf.c          |  3 ++-
3e5111
 src/qemu/qemu_domain.c        |  1 +
3e5111
 src/qemu/qemu_driver.c        |  5 +++--
3e5111
 src/security/virt-aa-helper.c |  2 +-
3e5111
 src/test/test_driver.c        |  6 ++++--
3e5111
 src/uml/uml_driver.c          |  2 +-
3e5111
 src/vbox/vbox_common.c        |  2 +-
3e5111
 src/vmware/vmware_driver.c    |  2 +-
3e5111
 src/vmx/vmx.c                 |  2 +-
3e5111
 src/vz/vz_driver.c            |  2 +-
3e5111
 src/xen/xen_driver.c          |  2 +-
3e5111
 src/xenapi/xenapi_driver.c    |  2 +-
3e5111
 tests/bhyveargv2xmltest.c     |  3 ++-
3e5111
 tests/qemuargv2xmltest.c      |  2 +-
3e5111
 tests/qemuxml2argvtest.c      |  2 +-
3e5111
 tests/sexpr2xmltest.c         |  2 +-
3e5111
 tests/testutils.c             |  4 ++--
3e5111
 tests/vmx2xmltest.c           |  2 +-
3e5111
 tests/xlconfigtest.c          |  2 +-
3e5111
 tests/xmconfigtest.c          |  2 +-
3e5111
 tests/xml2sexprtest.c         |  2 +-
3e5111
 tests/xml2vmxtest.c           |  2 +-
3e5111
 33 files changed, 73 insertions(+), 37 deletions(-)
3e5111
3e5111
diff --git a/src/bhyve/bhyve_domain.c b/src/bhyve/bhyve_domain.c
3e5111
index 76b4fac2c4..0a99550afa 100644
3e5111
--- a/src/bhyve/bhyve_domain.c
3e5111
+++ b/src/bhyve/bhyve_domain.c
3e5111
@@ -144,7 +144,7 @@ virBhyveDriverCreateXMLConf(bhyveConnPtr driver)
3e5111
     virBhyveDriverDomainDefParserConfig.priv = driver;
3e5111
     return virDomainXMLOptionNew(&virBhyveDriverDomainDefParserConfig,
3e5111
                                  &virBhyveDriverPrivateDataCallbacks,
3e5111
-                                 NULL);
3e5111
+                                 NULL, NULL);
3e5111
 }
3e5111
 
3e5111
 virDomainDefParserConfig virBhyveDriverDomainDefParserConfig = {
3e5111
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
3e5111
index 4404b8f737..bab85c6362 100644
3e5111
--- a/src/conf/domain_conf.c
3e5111
+++ b/src/conf/domain_conf.c
3e5111
@@ -76,6 +76,9 @@ struct _virDomainXMLOption {
3e5111
 
3e5111
     /* XML namespace callbacks */
3e5111
     virDomainXMLNamespace ns;
3e5111
+
3e5111
+    /* ABI stability callbacks */
3e5111
+    virDomainABIStability abi;
3e5111
 };
3e5111
 
3e5111
 #define VIR_DOMAIN_DEF_FORMAT_COMMON_FLAGS             \
3e5111
@@ -1050,7 +1053,8 @@ virDomainKeyWrapDefParseXML(virDomainDefPtr def, xmlXPathContextPtr ctxt)
3e5111
 virDomainXMLOptionPtr
3e5111
 virDomainXMLOptionNew(virDomainDefParserConfigPtr config,
3e5111
                       virDomainXMLPrivateDataCallbacksPtr priv,
3e5111
-                      virDomainXMLNamespacePtr xmlns)
3e5111
+                      virDomainXMLNamespacePtr xmlns,
3e5111
+                      virDomainABIStabilityPtr abi)
3e5111
 {
3e5111
     virDomainXMLOptionPtr xmlopt;
3e5111
 
3e5111
@@ -1069,6 +1073,9 @@ virDomainXMLOptionNew(virDomainDefParserConfigPtr config,
3e5111
     if (xmlns)
3e5111
         xmlopt->ns = *xmlns;
3e5111
 
3e5111
+    if (abi)
3e5111
+        xmlopt->abi = *abi;
3e5111
+
3e5111
     /* Technically this forbids to use one of Xerox's MAC address prefixes in
3e5111
      * our hypervisor drivers. This shouldn't ever be a problem.
3e5111
      *
3e5111
@@ -19911,6 +19918,7 @@ virDomainDefVcpuCheckAbiStability(virDomainDefPtr src,
3e5111
 bool
3e5111
 virDomainDefCheckABIStabilityFlags(virDomainDefPtr src,
3e5111
                                    virDomainDefPtr dst,
3e5111
+                                   virDomainXMLOptionPtr xmlopt,
3e5111
                                    unsigned int flags)
3e5111
 {
3e5111
     size_t i;
3e5111
@@ -20337,6 +20345,10 @@ virDomainDefCheckABIStabilityFlags(virDomainDefPtr src,
3e5111
         !virDomainIOMMUDefCheckABIStability(src->iommu, dst->iommu))
3e5111
         goto error;
3e5111
 
3e5111
+    if (xmlopt && xmlopt->abi.domain &&
3e5111
+        !xmlopt->abi.domain(src, dst))
3e5111
+        goto error;
3e5111
+
3e5111
     /* Coverity is not very happy with this - all dead_error_condition */
3e5111
 #if !STATIC_ANALYSIS
3e5111
     /* This switch statement is here to trigger compiler warning when adding
3e5111
@@ -20396,9 +20408,10 @@ virDomainDefCheckABIStabilityFlags(virDomainDefPtr src,
3e5111
 
3e5111
 bool
3e5111
 virDomainDefCheckABIStability(virDomainDefPtr src,
3e5111
-                              virDomainDefPtr dst)
3e5111
+                              virDomainDefPtr dst,
3e5111
+                              virDomainXMLOptionPtr xmlopt)
3e5111
 {
3e5111
-    return virDomainDefCheckABIStabilityFlags(src, dst, 0);
3e5111
+    return virDomainDefCheckABIStabilityFlags(src, dst, xmlopt, 0);
3e5111
 }
3e5111
 
3e5111
 
3e5111
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
3e5111
index 980aafa66a..d64ef1b6e9 100644
3e5111
--- a/src/conf/domain_conf.h
3e5111
+++ b/src/conf/domain_conf.h
3e5111
@@ -2537,9 +2537,19 @@ struct _virDomainXMLPrivateDataCallbacks {
3e5111
     virDomainXMLPrivateDataParseFunc  parse;
3e5111
 };
3e5111
 
3e5111
+typedef bool (*virDomainABIStabilityDomain)(const virDomainDef *src,
3e5111
+                                            const virDomainDef *dst);
3e5111
+
3e5111
+typedef struct _virDomainABIStability virDomainABIStability;
3e5111
+typedef virDomainABIStability *virDomainABIStabilityPtr;
3e5111
+struct _virDomainABIStability {
3e5111
+    virDomainABIStabilityDomain domain;
3e5111
+};
3e5111
+
3e5111
 virDomainXMLOptionPtr virDomainXMLOptionNew(virDomainDefParserConfigPtr config,
3e5111
                                             virDomainXMLPrivateDataCallbacksPtr priv,
3e5111
-                                            virDomainXMLNamespacePtr xmlns);
3e5111
+                                            virDomainXMLNamespacePtr xmlns,
3e5111
+                                            virDomainABIStabilityPtr abi);
3e5111
 
3e5111
 void virDomainNetGenerateMAC(virDomainXMLOptionPtr xmlopt, virMacAddrPtr mac);
3e5111
 
3e5111
@@ -2805,10 +2815,12 @@ virDomainObjPtr virDomainObjParseFile(const char *filename,
3e5111
                                       unsigned int flags);
3e5111
 
3e5111
 bool virDomainDefCheckABIStability(virDomainDefPtr src,
3e5111
-                                   virDomainDefPtr dst);
3e5111
+                                   virDomainDefPtr dst,
3e5111
+                                   virDomainXMLOptionPtr xmlopt);
3e5111
 
3e5111
 bool virDomainDefCheckABIStabilityFlags(virDomainDefPtr src,
3e5111
                                         virDomainDefPtr dst,
3e5111
+                                        virDomainXMLOptionPtr xmlopt,
3e5111
                                         unsigned int flags);
3e5111
 
3e5111
 int virDomainDefAddImplicitDevices(virDomainDefPtr def);
3e5111
diff --git a/src/conf/snapshot_conf.c b/src/conf/snapshot_conf.c
3e5111
index 5daa8d11a7..b6cba5ac38 100644
3e5111
--- a/src/conf/snapshot_conf.c
3e5111
+++ b/src/conf/snapshot_conf.c
3e5111
@@ -1198,6 +1198,7 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain,
3e5111
                               virDomainObjPtr vm,
3e5111
                               virDomainSnapshotDefPtr *defptr,
3e5111
                               virDomainSnapshotObjPtr *snap,
3e5111
+                              virDomainXMLOptionPtr xmlopt,
3e5111
                               bool *update_current,
3e5111
                               unsigned int flags)
3e5111
 {
3e5111
@@ -1286,7 +1287,7 @@ virDomainSnapshotRedefinePrep(virDomainPtr domain,
3e5111
         if (other->def->dom) {
3e5111
             if (def->dom) {
3e5111
                 if (!virDomainDefCheckABIStability(other->def->dom,
3e5111
-                                                   def->dom))
3e5111
+                                                   def->dom, xmlopt))
3e5111
                     goto cleanup;
3e5111
             } else {
3e5111
                 /* Transfer the domain def */
3e5111
diff --git a/src/conf/snapshot_conf.h b/src/conf/snapshot_conf.h
3e5111
index fcf7a1e824..da904f9460 100644
3e5111
--- a/src/conf/snapshot_conf.h
3e5111
+++ b/src/conf/snapshot_conf.h
3e5111
@@ -181,6 +181,7 @@ int virDomainSnapshotRedefinePrep(virDomainPtr domain,
3e5111
                                   virDomainObjPtr vm,
3e5111
                                   virDomainSnapshotDefPtr *def,
3e5111
                                   virDomainSnapshotObjPtr *snap,
3e5111
+                                  virDomainXMLOptionPtr xmlopt,
3e5111
                                   bool *update_current,
3e5111
                                   unsigned int flags);
3e5111
 
3e5111
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
3e5111
index 4bab651b33..dd345c22cf 100644
3e5111
--- a/src/libxl/libxl_conf.c
3e5111
+++ b/src/libxl/libxl_conf.c
3e5111
@@ -2147,5 +2147,5 @@ libxlCreateXMLConf(void)
3e5111
 {
3e5111
     return virDomainXMLOptionNew(&libxlDomainDefParserConfig,
3e5111
                                  &libxlDomainXMLPrivateDataCallbacks,
3e5111
-                                 NULL);
3e5111
+                                 NULL, NULL);
3e5111
 }
3e5111
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
3e5111
index ea28c93345..2d8852d280 100644
3e5111
--- a/src/libxl/libxl_domain.c
3e5111
+++ b/src/libxl/libxl_domain.c
3e5111
@@ -1452,7 +1452,9 @@ libxlDomainDefCheckABIStability(libxlDriverPrivatePtr driver,
3e5111
         !(migratableDefDst = virDomainDefCopy(dst, cfg->caps, driver->xmlopt, NULL, true)))
3e5111
         goto cleanup;
3e5111
 
3e5111
-    ret = virDomainDefCheckABIStability(migratableDefSrc, migratableDefDst);
3e5111
+    ret = virDomainDefCheckABIStability(migratableDefSrc,
3e5111
+                                        migratableDefDst,
3e5111
+                                        driver->xmlopt);
3e5111
 
3e5111
  cleanup:
3e5111
     virDomainDefFree(migratableDefSrc);
3e5111
diff --git a/src/lxc/lxc_conf.c b/src/lxc/lxc_conf.c
3e5111
index e47b667f58..b46fbc58ff 100644
3e5111
--- a/src/lxc/lxc_conf.c
3e5111
+++ b/src/lxc/lxc_conf.c
3e5111
@@ -212,7 +212,8 @@ lxcDomainXMLConfInit(void)
3e5111
 {
3e5111
     return virDomainXMLOptionNew(&virLXCDriverDomainDefParserConfig,
3e5111
                                  &virLXCDriverPrivateDataCallbacks,
3e5111
-                                 &virLXCDriverDomainXMLNamespace);
3e5111
+                                 &virLXCDriverDomainXMLNamespace,
3e5111
+                                 NULL);
3e5111
 }
3e5111
 
3e5111
 
3e5111
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
3e5111
index 647c8522dd..44a6631a99 100644
3e5111
--- a/src/openvz/openvz_driver.c
3e5111
+++ b/src/openvz/openvz_driver.c
3e5111
@@ -1493,7 +1493,7 @@ static virDrvOpenStatus openvzConnectOpen(virConnectPtr conn,
3e5111
         goto cleanup;
3e5111
 
3e5111
     if (!(driver->xmlopt = virDomainXMLOptionNew(&openvzDomainDefParserConfig,
3e5111
-                                                 NULL, NULL)))
3e5111
+                                                 NULL, NULL, NULL)))
3e5111
         goto cleanup;
3e5111
 
3e5111
     if (openvzLoadDomains(driver) < 0)
3e5111
diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
3e5111
index 1803aa53b7..e85f66ffab 100644
3e5111
--- a/src/phyp/phyp_driver.c
3e5111
+++ b/src/phyp/phyp_driver.c
3e5111
@@ -1199,7 +1199,7 @@ phypConnectOpen(virConnectPtr conn,
3e5111
         goto failure;
3e5111
 
3e5111
     if (!(phyp_driver->xmlopt = virDomainXMLOptionNew(&virPhypDriverDomainDefParserConfig,
3e5111
-                                                      NULL, NULL)))
3e5111
+                                                      NULL, NULL, NULL)))
3e5111
         goto failure;
3e5111
 
3e5111
     conn->privateData = phyp_driver;
3e5111
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
3e5111
index 80db60bc4b..72d3f25763 100644
3e5111
--- a/src/qemu/qemu_capabilities.c
3e5111
+++ b/src/qemu/qemu_capabilities.c
3e5111
@@ -5027,7 +5027,7 @@ virQEMUCapsInitQMPCommandRun(virQEMUCapsInitQMPCommandPtr cmd,
3e5111
         goto ignore;
3e5111
     }
3e5111
 
3e5111
-    if (!(xmlopt = virDomainXMLOptionNew(NULL, NULL, NULL)) ||
3e5111
+    if (!(xmlopt = virDomainXMLOptionNew(NULL, NULL, NULL, NULL)) ||
3e5111
         !(cmd->vm = virDomainObjNew(xmlopt)))
3e5111
         goto cleanup;
3e5111
 
3e5111
diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
3e5111
index 7324c9c415..e73a7b3781 100644
3e5111
--- a/src/qemu/qemu_conf.c
3e5111
+++ b/src/qemu/qemu_conf.c
3e5111
@@ -907,7 +907,8 @@ virQEMUDriverCreateXMLConf(virQEMUDriverPtr driver)
3e5111
     virQEMUDriverDomainDefParserConfig.priv = driver;
3e5111
     return virDomainXMLOptionNew(&virQEMUDriverDomainDefParserConfig,
3e5111
                                  &virQEMUDriverPrivateDataCallbacks,
3e5111
-                                 &virQEMUDriverDomainXMLNamespace);
3e5111
+                                 &virQEMUDriverDomainXMLNamespace,
3e5111
+                                 NULL);
3e5111
 }
3e5111
 
3e5111
 
3e5111
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
3e5111
index 89698d4fcd..e5da82aacc 100644
3e5111
--- a/src/qemu/qemu_domain.c
3e5111
+++ b/src/qemu/qemu_domain.c
3e5111
@@ -5811,6 +5811,7 @@ qemuDomainDefCheckABIStability(virQEMUDriverPtr driver,
3e5111
 
3e5111
     if (!virDomainDefCheckABIStabilityFlags(migratableDefSrc,
3e5111
                                             migratableDefDst,
3e5111
+                                            driver->xmlopt,
3e5111
                                             check_flags))
3e5111
         goto cleanup;
3e5111
 
3e5111
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
3e5111
index fdfa4a50e1..a9ac06a63c 100644
3e5111
--- a/src/qemu/qemu_driver.c
3e5111
+++ b/src/qemu/qemu_driver.c
3e5111
@@ -6136,7 +6136,7 @@ qemuDomainSaveImageUpdateDef(virQEMUDriverPtr driver,
3e5111
                                           VIR_DOMAIN_XML_MIGRATABLE)))
3e5111
         goto cleanup;
3e5111
 
3e5111
-    if (!virDomainDefCheckABIStability(def, newdef_migr)) {
3e5111
+    if (!virDomainDefCheckABIStability(def, newdef_migr, driver->xmlopt)) {
3e5111
         virErrorPtr err = virSaveLastError();
3e5111
 
3e5111
         /* Due to a bug in older version of external snapshot creation
3e5111
@@ -6145,7 +6145,7 @@ qemuDomainSaveImageUpdateDef(virQEMUDriverPtr driver,
3e5111
          * saved XML type, we need to check the ABI compatibility against
3e5111
          * the user provided XML if the check against the migratable XML
3e5111
          * fails. Snapshots created prior to v1.1.3 have this issue. */
3e5111
-        if (!virDomainDefCheckABIStability(def, newdef)) {
3e5111
+        if (!virDomainDefCheckABIStability(def, newdef, driver->xmlopt)) {
3e5111
             virSetError(err);
3e5111
             virFreeError(err);
3e5111
             goto cleanup;
3e5111
@@ -14589,6 +14589,7 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
3e5111
 
3e5111
     if (redefine) {
3e5111
         if (virDomainSnapshotRedefinePrep(domain, vm, &def, &snap,
3e5111
+                                          driver->xmlopt,
3e5111
                                           &update_current, flags) < 0)
3e5111
             goto endjob;
3e5111
     } else {
3e5111
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
3e5111
index 5f5d1cd710..48201d5b8c 100644
3e5111
--- a/src/security/virt-aa-helper.c
3e5111
+++ b/src/security/virt-aa-helper.c
3e5111
@@ -667,7 +667,7 @@ get_definition(vahControl * ctl, const char *xmlStr)
3e5111
         goto exit;
3e5111
     }
3e5111
 
3e5111
-    if (!(ctl->xmlopt = virDomainXMLOptionNew(NULL, NULL, NULL))) {
3e5111
+    if (!(ctl->xmlopt = virDomainXMLOptionNew(NULL, NULL, NULL, NULL))) {
3e5111
         vah_error(ctl, 0, _("Failed to create XML config object"));
3e5111
         goto exit;
3e5111
     }
3e5111
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
3e5111
index 866949558b..39df646260 100644
3e5111
--- a/src/test/test_driver.c
3e5111
+++ b/src/test/test_driver.c
3e5111
@@ -414,7 +414,7 @@ testDriverNew(void)
3e5111
         goto error;
3e5111
     }
3e5111
 
3e5111
-    if (!(ret->xmlopt = virDomainXMLOptionNew(NULL, NULL, &ns)) ||
3e5111
+    if (!(ret->xmlopt = virDomainXMLOptionNew(NULL, NULL, &ns, NULL)) ||
3e5111
         !(ret->eventState = virObjectEventStateNew()) ||
3e5111
         !(ret->domains = virDomainObjListNew()) ||
3e5111
         !(ret->networks = virNetworkObjListNew()))
3e5111
@@ -6486,6 +6486,7 @@ testDomainSnapshotCreateXML(virDomainPtr domain,
3e5111
 
3e5111
     if (redefine) {
3e5111
         if (virDomainSnapshotRedefinePrep(domain, vm, &def, &snap,
3e5111
+                                          privconn->xmlopt,
3e5111
                                           &update_current, flags) < 0)
3e5111
             goto cleanup;
3e5111
     } else {
3e5111
@@ -6761,7 +6762,8 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
3e5111
         if (virDomainObjIsActive(vm)) {
3e5111
             /* Transitions 5, 6, 8, 9 */
3e5111
             /* Check for ABI compatibility.  */
3e5111
-            if (!virDomainDefCheckABIStability(vm->def, config)) {
3e5111
+            if (!virDomainDefCheckABIStability(vm->def, config,
3e5111
+                                               privconn->xmlopt)) {
3e5111
                 virErrorPtr err = virGetLastError();
3e5111
 
3e5111
                 if (!(flags & VIR_DOMAIN_SNAPSHOT_REVERT_FORCE)) {
3e5111
diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c
3e5111
index 532ce3b1f3..ae75daa596 100644
3e5111
--- a/src/uml/uml_driver.c
3e5111
+++ b/src/uml/uml_driver.c
3e5111
@@ -533,7 +533,7 @@ umlStateInitialize(bool privileged,
3e5111
         goto out_of_memory;
3e5111
 
3e5111
     if (!(uml_driver->xmlopt = virDomainXMLOptionNew(&umlDriverDomainDefParserConfig,
3e5111
-                                                     &privcb, NULL)))
3e5111
+                                                     &privcb, NULL, NULL)))
3e5111
         goto error;
3e5111
 
3e5111
     if ((uml_driver->inotifyFD = inotify_init()) < 0) {
3e5111
diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c
3e5111
index b71506ae5d..dcc64b579c 100644
3e5111
--- a/src/vbox/vbox_common.c
3e5111
+++ b/src/vbox/vbox_common.c
3e5111
@@ -139,7 +139,7 @@ vboxDriverObjNew(void)
3e5111
 
3e5111
     if (!(driver->caps = vboxCapsInit()) ||
3e5111
         !(driver->xmlopt = virDomainXMLOptionNew(&vboxDomainDefParserConfig,
3e5111
-                                                 NULL, NULL)))
3e5111
+                                                 NULL, NULL, NULL)))
3e5111
         goto cleanup;
3e5111
 
3e5111
     return driver;
3e5111
diff --git a/src/vmware/vmware_driver.c b/src/vmware/vmware_driver.c
3e5111
index d3497bd2d5..24e97a4969 100644
3e5111
--- a/src/vmware/vmware_driver.c
3e5111
+++ b/src/vmware/vmware_driver.c
3e5111
@@ -114,7 +114,7 @@ vmwareDomainXMLConfigInit(void)
3e5111
     virDomainXMLPrivateDataCallbacks priv = { .alloc = vmwareDataAllocFunc,
3e5111
                                               .free = vmwareDataFreeFunc };
3e5111
 
3e5111
-    return virDomainXMLOptionNew(&vmwareDomainDefParserConfig, &priv, NULL);
3e5111
+    return virDomainXMLOptionNew(&vmwareDomainDefParserConfig, &priv, NULL, NULL);
3e5111
 }
3e5111
 
3e5111
 static virDrvOpenStatus
3e5111
diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
3e5111
index 31af2e9df4..3289a20026 100644
3e5111
--- a/src/vmx/vmx.c
3e5111
+++ b/src/vmx/vmx.c
3e5111
@@ -591,7 +591,7 @@ virDomainXMLOptionPtr
3e5111
 virVMXDomainXMLConfInit(void)
3e5111
 {
3e5111
     return virDomainXMLOptionNew(&virVMXDomainDefParserConfig, NULL,
3e5111
-                                 &virVMXDomainXMLNamespace);
3e5111
+                                 &virVMXDomainXMLNamespace, NULL);
3e5111
 }
3e5111
 
3e5111
 char *
3e5111
diff --git a/src/vz/vz_driver.c b/src/vz/vz_driver.c
3e5111
index 88f1960eb1..26c4f48459 100644
3e5111
--- a/src/vz/vz_driver.c
3e5111
+++ b/src/vz/vz_driver.c
3e5111
@@ -326,7 +326,7 @@ vzDriverObjNew(void)
3e5111
     if (!(driver->caps = vzBuildCapabilities()) ||
3e5111
         !(driver->xmlopt = virDomainXMLOptionNew(&vzDomainDefParserConfig,
3e5111
                                                  &vzDomainXMLPrivateDataCallbacksPtr,
3e5111
-                                                 NULL)) ||
3e5111
+                                                 NULL, NULL)) ||
3e5111
         !(driver->domains = virDomainObjListNew()) ||
3e5111
         !(driver->domainEventState = virObjectEventStateNew()) ||
3e5111
         (vzInitVersion(driver) < 0) ||
3e5111
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
3e5111
index 7a2f4a1a60..0c160f8370 100644
3e5111
--- a/src/xen/xen_driver.c
3e5111
+++ b/src/xen/xen_driver.c
3e5111
@@ -401,7 +401,7 @@ virDomainXMLOptionPtr
3e5111
 xenDomainXMLConfInit(void)
3e5111
 {
3e5111
     return virDomainXMLOptionNew(&xenDomainDefParserConfig,
3e5111
-                                 NULL, NULL);
3e5111
+                                 NULL, NULL, NULL);
3e5111
 }
3e5111
 
3e5111
 
3e5111
diff --git a/src/xenapi/xenapi_driver.c b/src/xenapi/xenapi_driver.c
3e5111
index a9ed407bc5..5623ddb507 100644
3e5111
--- a/src/xenapi/xenapi_driver.c
3e5111
+++ b/src/xenapi/xenapi_driver.c
3e5111
@@ -200,7 +200,7 @@ xenapiConnectOpen(virConnectPtr conn, virConnectAuthPtr auth,
3e5111
     }
3e5111
 
3e5111
     if (!(privP->xmlopt = virDomainXMLOptionNew(&xenapiDomainDefParserConfig,
3e5111
-                                                NULL, NULL))) {
3e5111
+                                                NULL, NULL, NULL))) {
3e5111
         xenapiSessionErrorHandler(conn, VIR_ERR_INTERNAL_ERROR,
3e5111
                                   _("Failed to create XML conf object"));
3e5111
         goto error;
3e5111
diff --git a/tests/bhyveargv2xmltest.c b/tests/bhyveargv2xmltest.c
3e5111
index e759e4fa30..5d7261a45b 100644
3e5111
--- a/tests/bhyveargv2xmltest.c
3e5111
+++ b/tests/bhyveargv2xmltest.c
3e5111
@@ -130,7 +130,8 @@ mymain(void)
3e5111
     if ((driver.caps = virBhyveCapsBuild()) == NULL)
3e5111
         return EXIT_FAILURE;
3e5111
 
3e5111
-    if ((driver.xmlopt = virDomainXMLOptionNew(NULL, NULL, NULL)) == NULL)
3e5111
+    if ((driver.xmlopt = virDomainXMLOptionNew(NULL, NULL,
3e5111
+                                               NULL, NULL)) == NULL)
3e5111
         return EXIT_FAILURE;
3e5111
 
3e5111
 # define DO_TEST_FULL(name, flags)                            \
3e5111
diff --git a/tests/qemuargv2xmltest.c b/tests/qemuargv2xmltest.c
3e5111
index a709c72cf1..01d2426be5 100644
3e5111
--- a/tests/qemuargv2xmltest.c
3e5111
+++ b/tests/qemuargv2xmltest.c
3e5111
@@ -95,7 +95,7 @@ static int testCompareXMLToArgvFiles(const char *xmlfile,
3e5111
     if (testSanitizeDef(vmdef) < 0)
3e5111
         goto fail;
3e5111
 
3e5111
-    if (!virDomainDefCheckABIStability(vmdef, vmdef)) {
3e5111
+    if (!virDomainDefCheckABIStability(vmdef, vmdef, driver.xmlopt)) {
3e5111
         VIR_TEST_DEBUG("ABI stability check failed on %s", xmlfile);
3e5111
         goto fail;
3e5111
     }
3e5111
diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
3e5111
index ecdda2db93..9e0d4d7141 100644
3e5111
--- a/tests/qemuxml2argvtest.c
3e5111
+++ b/tests/qemuxml2argvtest.c
3e5111
@@ -464,7 +464,7 @@ testCompareXMLToArgv(const void *data)
3e5111
     if (virBitmapParse("0-3", &priv->autoNodeset, 4) < 0)
3e5111
         goto cleanup;
3e5111
 
3e5111
-    if (!virDomainDefCheckABIStability(vm->def, vm->def)) {
3e5111
+    if (!virDomainDefCheckABIStability(vm->def, vm->def, driver.xmlopt)) {
3e5111
         VIR_TEST_DEBUG("ABI stability check failed on %s", xml);
3e5111
         goto cleanup;
3e5111
     }
3e5111
diff --git a/tests/sexpr2xmltest.c b/tests/sexpr2xmltest.c
3e5111
index 9982fad9f7..91f751d671 100644
3e5111
--- a/tests/sexpr2xmltest.c
3e5111
+++ b/tests/sexpr2xmltest.c
3e5111
@@ -57,7 +57,7 @@ testCompareFiles(const char *xml, const char *sexpr)
3e5111
                                  tty, vncport, caps, xmlopt)))
3e5111
       goto fail;
3e5111
 
3e5111
-  if (!virDomainDefCheckABIStability(def, def)) {
3e5111
+  if (!virDomainDefCheckABIStability(def, def, xmlopt)) {
3e5111
       fprintf(stderr, "ABI stability check failed on %s", xml);
3e5111
       goto fail;
3e5111
   }
3e5111
diff --git a/tests/testutils.c b/tests/testutils.c
3e5111
index f3feb6d3f9..b7dc8d8408 100644
3e5111
--- a/tests/testutils.c
3e5111
+++ b/tests/testutils.c
3e5111
@@ -1136,7 +1136,7 @@ virDomainXMLOptionPtr virTestGenericDomainXMLConfInit(void)
3e5111
 {
3e5111
     return virDomainXMLOptionNew(&virTestGenericDomainDefParserConfig,
3e5111
                                  &virTestGenericPrivateDataCallbacks,
3e5111
-                                 NULL);
3e5111
+                                 NULL, NULL);
3e5111
 }
3e5111
 
3e5111
 
3e5111
@@ -1169,7 +1169,7 @@ testCompareDomXML2XMLFiles(virCapsPtr caps, virDomainXMLOptionPtr xmlopt,
3e5111
         goto out;
3e5111
     }
3e5111
 
3e5111
-    if (!virDomainDefCheckABIStability(def, def)) {
3e5111
+    if (!virDomainDefCheckABIStability(def, def, xmlopt)) {
3e5111
         VIR_TEST_DEBUG("ABI stability check failed on %s", infile);
3e5111
         result = TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_STABILITY;
3e5111
         goto out;
3e5111
diff --git a/tests/vmx2xmltest.c b/tests/vmx2xmltest.c
3e5111
index 9b59fd5ea7..bcaf4bb175 100644
3e5111
--- a/tests/vmx2xmltest.c
3e5111
+++ b/tests/vmx2xmltest.c
3e5111
@@ -81,7 +81,7 @@ testCompareFiles(const char *vmx, const char *xml)
3e5111
     if (!(def = virVMXParseConfig(&ctx, xmlopt, caps, vmxData)))
3e5111
         goto cleanup;
3e5111
 
3e5111
-    if (!virDomainDefCheckABIStability(def, def)) {
3e5111
+    if (!virDomainDefCheckABIStability(def, def, xmlopt)) {
3e5111
         fprintf(stderr, "ABI stability check failed on %s", vmx);
3e5111
         goto cleanup;
3e5111
     }
3e5111
diff --git a/tests/xlconfigtest.c b/tests/xlconfigtest.c
3e5111
index e74e4d60db..4d801ecdda 100644
3e5111
--- a/tests/xlconfigtest.c
3e5111
+++ b/tests/xlconfigtest.c
3e5111
@@ -97,7 +97,7 @@ testCompareParseXML(const char *xlcfg, const char *xml, bool replaceVars)
3e5111
             goto fail;
3e5111
     }
3e5111
 
3e5111
-    if (!virDomainDefCheckABIStability(def, def)) {
3e5111
+    if (!virDomainDefCheckABIStability(def, def, xmlopt)) {
3e5111
         fprintf(stderr, "ABI stability check failed on %s", xml);
3e5111
         goto fail;
3e5111
     }
3e5111
diff --git a/tests/xmconfigtest.c b/tests/xmconfigtest.c
3e5111
index 63997777cc..d7454415cd 100644
3e5111
--- a/tests/xmconfigtest.c
3e5111
+++ b/tests/xmconfigtest.c
3e5111
@@ -67,7 +67,7 @@ testCompareParseXML(const char *xmcfg, const char *xml)
3e5111
                                       VIR_DOMAIN_DEF_PARSE_INACTIVE)))
3e5111
         goto fail;
3e5111
 
3e5111
-    if (!virDomainDefCheckABIStability(def, def)) {
3e5111
+    if (!virDomainDefCheckABIStability(def, def, xmlopt)) {
3e5111
         fprintf(stderr, "ABI stability check failed on %s", xml);
3e5111
         goto fail;
3e5111
     }
3e5111
diff --git a/tests/xml2sexprtest.c b/tests/xml2sexprtest.c
3e5111
index 0b95113118..a6a7a9ed3d 100644
3e5111
--- a/tests/xml2sexprtest.c
3e5111
+++ b/tests/xml2sexprtest.c
3e5111
@@ -31,7 +31,7 @@ testCompareFiles(const char *xml, const char *sexpr)
3e5111
                                     VIR_DOMAIN_DEF_PARSE_INACTIVE)))
3e5111
       goto fail;
3e5111
 
3e5111
-  if (!virDomainDefCheckABIStability(def, def)) {
3e5111
+  if (!virDomainDefCheckABIStability(def, def, xmlopt)) {
3e5111
       fprintf(stderr, "ABI stability check failed on %s", xml);
3e5111
       goto fail;
3e5111
   }
3e5111
diff --git a/tests/xml2vmxtest.c b/tests/xml2vmxtest.c
3e5111
index b77be893c6..6242d46a5f 100644
3e5111
--- a/tests/xml2vmxtest.c
3e5111
+++ b/tests/xml2vmxtest.c
3e5111
@@ -82,7 +82,7 @@ testCompareFiles(const char *xml, const char *vmx, int virtualHW_version)
3e5111
     if (def == NULL)
3e5111
         goto failure;
3e5111
 
3e5111
-    if (!virDomainDefCheckABIStability(def, def)) {
3e5111
+    if (!virDomainDefCheckABIStability(def, def, xmlopt)) {
3e5111
         fprintf(stderr, "ABI stability check failed on %s", xml);
3e5111
         goto failure;
3e5111
     }
3e5111
-- 
3e5111
2.13.1
3e5111