We want to by pass the proper opaque pointer instead of NULL to
virDomainDefParseString.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/domain_conf.c | 7 ++++---
src/conf/domain_conf.h | 1 +
src/libxl/libxl_domain.c | 4 ++--
src/qemu/qemu_domain.c | 2 +-
src/qemu/qemu_driver.c | 3 ++-
src/test/test_driver.c | 5 +++--
src/xen/xm_internal.c | 1 +
7 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 6f5bf2e..1d8d7c1 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2973,7 +2973,7 @@ virDomainObjSetDefTransient(virCapsPtr caps,
if (domain->newDef)
return 0;
- if (!(domain->newDef = virDomainDefCopy(domain->def, caps, xmlopt, false)))
+ if (!(domain->newDef = virDomainDefCopy(domain->def, caps, xmlopt, NULL,
false)))
goto out;
ret = 0;
@@ -24661,6 +24661,7 @@ virDomainDefPtr
virDomainDefCopy(virDomainDefPtr src,
virCapsPtr caps,
virDomainXMLOptionPtr xmlopt,
+ void *parseOpaque,
bool migratable)
{
char *xml;
@@ -24676,7 +24677,7 @@ virDomainDefCopy(virDomainDefPtr src,
if (!(xml = virDomainDefFormat(src, caps, format_flags)))
return NULL;
- ret = virDomainDefParseString(xml, caps, xmlopt, NULL, parse_flags);
+ ret = virDomainDefParseString(xml, caps, xmlopt, parseOpaque, parse_flags);
VIR_FREE(xml);
return ret;
@@ -24690,7 +24691,7 @@ virDomainObjCopyPersistentDef(virDomainObjPtr dom,
virDomainDefPtr cur;
cur = virDomainObjGetPersistentDef(caps, xmlopt, dom);
- return virDomainDefCopy(cur, caps, xmlopt, false);
+ return virDomainDefCopy(cur, caps, xmlopt, NULL, false);
}
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 30ab1a5..a6554f5 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2604,6 +2604,7 @@ virDomainDefPtr virDomainObjGetOneDef(virDomainObjPtr vm, unsigned
int flags);
virDomainDefPtr virDomainDefCopy(virDomainDefPtr src,
virCapsPtr caps,
virDomainXMLOptionPtr xmlopt,
+ void *parseOpaque,
bool migratable);
virDomainDefPtr virDomainObjCopyPersistentDef(virDomainObjPtr dom,
virCapsPtr caps,
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index 50385fd..fb63a03 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -1365,8 +1365,8 @@ libxlDomainDefCheckABIStability(libxlDriverPrivatePtr driver,
libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
bool ret = false;
- if (!(migratableDefSrc = virDomainDefCopy(src, cfg->caps, driver->xmlopt,
true)) ||
- !(migratableDefDst = virDomainDefCopy(dst, cfg->caps, driver->xmlopt,
true)))
+ if (!(migratableDefSrc = virDomainDefCopy(src, cfg->caps, driver->xmlopt, NULL,
true)) ||
+ !(migratableDefDst = virDomainDefCopy(dst, cfg->caps, driver->xmlopt, NULL,
true)))
goto cleanup;
ret = virDomainDefCheckABIStability(migratableDefSrc, migratableDefDst);
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 9f67eaf..97f8993 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -3391,7 +3391,7 @@ qemuDomainDefFormatBuf(virQEMUDriverPtr driver,
if (!(flags & (VIR_DOMAIN_XML_UPDATE_CPU | VIR_DOMAIN_XML_MIGRATABLE)))
goto format;
- if (!(copy = virDomainDefCopy(def, caps, driver->xmlopt,
+ if (!(copy = virDomainDefCopy(def, caps, driver->xmlopt, NULL,
flags & VIR_DOMAIN_XML_MIGRATABLE)))
goto cleanup;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 4ed12bb..3e68a81 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15239,7 +15239,8 @@ qemuDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
* than inactive xml? */
snap->def->current = true;
if (snap->def->dom) {
- config = virDomainDefCopy(snap->def->dom, caps, driver->xmlopt, true);
+ config = virDomainDefCopy(snap->def->dom, caps,
+ driver->xmlopt, NULL, true);
if (!config)
goto endjob;
}
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index bf5c1b0..a382d89 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -6416,6 +6416,7 @@ testDomainSnapshotCreateXML(virDomainPtr domain,
if (!(def->dom = virDomainDefCopy(vm->def,
privconn->caps,
privconn->xmlopt,
+ NULL,
true)))
goto cleanup;
@@ -6670,8 +6671,8 @@ testDomainRevertToSnapshot(virDomainSnapshotPtr snapshot,
}
snap->def->current = true;
- config = virDomainDefCopy(snap->def->dom,
- privconn->caps, privconn->xmlopt, true);
+ config = virDomainDefCopy(snap->def->dom, privconn->caps,
+ privconn->xmlopt, NULL, true);
if (!config)
goto cleanup;
diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index 8335078..10c9097 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -517,6 +517,7 @@ xenXMDomainGetXMLDesc(virConnectPtr conn,
ret = virDomainDefCopy(entry->def,
priv->caps,
priv->xmlopt,
+ NULL,
false);
cleanup:
--
2.8.4