Blob Blame History Raw
From c6dcdb3a528ca4fb8f06118a28b53ab7d174d26a Mon Sep 17 00:00:00 2001
Message-Id: <c6dcdb3a528ca4fb8f06118a28b53ab7d174d26a@dist-git>
From: Michal Privoznik <mprivozn@redhat.com>
Date: Mon, 5 Jun 2017 09:35:23 +0200
Subject: [PATCH] virDomainXMLOption: Introduce virDomainABIStabilityDomain

https://bugzilla.redhat.com/show_bug.cgi?id=1450349

While checking for ABI stability, drivers might pose additional
checks that are not valid for general case. For instance, qemu
driver might check some memory backing attributes because of how
qemu works. But those attributes may work well in other drivers.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
(cherry picked from commit 4f0aeed8713b679dd024542f4823efcef1473f4f)
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/bhyve/bhyve_domain.c      |  2 +-
 src/conf/domain_conf.c        | 19 ++++++++++++++++---
 src/conf/domain_conf.h        | 16 ++++++++++++++--
 src/conf/snapshot_conf.c      |  3 ++-
 src/conf/snapshot_conf.h      |  1 +
 src/libxl/libxl_conf.c        |  2 +-
 src/libxl/libxl_domain.c      |  4 +++-
 src/lxc/lxc_conf.c            |  3 ++-
 src/openvz/openvz_driver.c    |  2 +-
 src/phyp/phyp_driver.c        |  2 +-
 src/qemu/qemu_capabilities.c  |  2 +-
 src/qemu/qemu_conf.c          |  3 ++-
 src/qemu/qemu_domain.c        |  1 +
 src/qemu/qemu_driver.c        |  5 +++--
 src/security/virt-aa-helper.c |  2 +-
 src/test/test_driver.c        |  6 ++++--
 src/uml/uml_driver.c          |  2 +-
 src/vbox/vbox_common.c        |  2 +-
 src/vmware/vmware_driver.c    |  2 +-
 src/vmx/vmx.c                 |  2 +-
 src/vz/vz_driver.c            |  2 +-
 src/xen/xen_driver.c          |  2 +-
 src/xenapi/xenapi_driver.c    |  2 +-
 tests/bhyveargv2xmltest.c     |  3 ++-
 tests/qemuargv2xmltest.c      |  2 +-
 tests/qemuxml2argvtest.c      |  2 +-
 tests/sexpr2xmltest.c         |  2 +-
 tests/testutils.c             |  4 ++--
 tests/vmx2xmltest.c           |  2 +-
 tests/xlconfigtest.c          |  2 +-
 tests/xmconfigtest.c          |  2 +-
 tests/xml2sexprtest.c         |  2 +-
 tests/xml2vmxtest.c           |  2 +-
 33 files changed, 73 insertions(+), 37 deletions(-)

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