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