virDomainDefCopy: Introduce @parseOpaque argument

We want to pass the proper opaque pointer instead of NULL to
virDomainDefParseString.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2016-09-22 17:23:03 +02:00
parent c41b989112
commit 2e056b5c51
7 changed files with 14 additions and 9 deletions

View File

@ -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);
}

View File

@ -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,

View File

@ -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);

View File

@ -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;

View File

@ -15232,7 +15232,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;
}

View File

@ -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;

View File

@ -517,6 +517,7 @@ xenXMDomainGetXMLDesc(virConnectPtr conn,
ret = virDomainDefCopy(entry->def,
priv->caps,
priv->xmlopt,
NULL,
false);
cleanup: