mirror of https://gitee.com/openkylin/libvirt.git
virDomainDefParse{File,String}: Introduce @parseOpaque argument
We want to pass the proper opaque pointer instead of NULL to virDomainDefParse and subsequently virDomainDefParseNode too. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
da6c604af2
commit
c41b989112
|
@ -538,7 +538,7 @@ bhyveDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flag
|
|||
return NULL;
|
||||
|
||||
if ((def = virDomainDefParseString(xml, caps, privconn->xmlopt,
|
||||
parse_flags)) == NULL)
|
||||
NULL, parse_flags)) == NULL)
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainDefineXMLFlagsEnsureACL(conn, def) < 0)
|
||||
|
@ -725,7 +725,7 @@ bhyveConnectDomainXMLToNative(virConnectPtr conn,
|
|||
goto cleanup;
|
||||
|
||||
if (!(def = virDomainDefParseString(xmlData, caps, privconn->xmlopt,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
|
||||
NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE)))
|
||||
goto cleanup;
|
||||
|
||||
if (bhyveDomainAssignAddresses(def, NULL) < 0)
|
||||
|
@ -938,7 +938,7 @@ bhyveDomainCreateXML(virConnectPtr conn,
|
|||
return NULL;
|
||||
|
||||
if ((def = virDomainDefParseString(xml, caps, privconn->xmlopt,
|
||||
parse_flags)) == NULL)
|
||||
NULL, parse_flags)) == NULL)
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainCreateXMLEnsureACL(conn, def) < 0)
|
||||
|
|
|
@ -17751,6 +17751,7 @@ virDomainDefParse(const char *xmlStr,
|
|||
const char *filename,
|
||||
virCapsPtr caps,
|
||||
virDomainXMLOptionPtr xmlopt,
|
||||
void *parseOpaque,
|
||||
unsigned int flags)
|
||||
{
|
||||
xmlDocPtr xml;
|
||||
|
@ -17759,7 +17760,7 @@ virDomainDefParse(const char *xmlStr,
|
|||
|
||||
if ((xml = virXMLParse(filename, xmlStr, _("(domain_definition)")))) {
|
||||
def = virDomainDefParseNode(xml, xmlDocGetRootElement(xml), caps,
|
||||
xmlopt, NULL, flags);
|
||||
xmlopt, parseOpaque, flags);
|
||||
xmlFreeDoc(xml);
|
||||
}
|
||||
|
||||
|
@ -17771,18 +17772,20 @@ virDomainDefPtr
|
|||
virDomainDefParseString(const char *xmlStr,
|
||||
virCapsPtr caps,
|
||||
virDomainXMLOptionPtr xmlopt,
|
||||
void *parseOpaque,
|
||||
unsigned int flags)
|
||||
{
|
||||
return virDomainDefParse(xmlStr, NULL, caps, xmlopt, flags);
|
||||
return virDomainDefParse(xmlStr, NULL, caps, xmlopt, parseOpaque, flags);
|
||||
}
|
||||
|
||||
virDomainDefPtr
|
||||
virDomainDefParseFile(const char *filename,
|
||||
virCapsPtr caps,
|
||||
virDomainXMLOptionPtr xmlopt,
|
||||
void *parseOpaque,
|
||||
unsigned int flags)
|
||||
{
|
||||
return virDomainDefParse(NULL, filename, caps, xmlopt, flags);
|
||||
return virDomainDefParse(NULL, filename, caps, xmlopt, parseOpaque, flags);
|
||||
}
|
||||
|
||||
|
||||
|
@ -24673,7 +24676,7 @@ virDomainDefCopy(virDomainDefPtr src,
|
|||
if (!(xml = virDomainDefFormat(src, caps, format_flags)))
|
||||
return NULL;
|
||||
|
||||
ret = virDomainDefParseString(xml, caps, xmlopt, parse_flags);
|
||||
ret = virDomainDefParseString(xml, caps, xmlopt, NULL, parse_flags);
|
||||
|
||||
VIR_FREE(xml);
|
||||
return ret;
|
||||
|
|
|
@ -2675,10 +2675,12 @@ virStorageSourcePtr virDomainDiskDefSourceParse(const char *xmlStr,
|
|||
virDomainDefPtr virDomainDefParseString(const char *xmlStr,
|
||||
virCapsPtr caps,
|
||||
virDomainXMLOptionPtr xmlopt,
|
||||
void *parseOpaque,
|
||||
unsigned int flags);
|
||||
virDomainDefPtr virDomainDefParseFile(const char *filename,
|
||||
virCapsPtr caps,
|
||||
virDomainXMLOptionPtr xmlopt,
|
||||
void *parseOpaque,
|
||||
unsigned int flags);
|
||||
virDomainDefPtr virDomainDefParseNode(xmlDocPtr doc,
|
||||
xmlNodePtr root,
|
||||
|
|
|
@ -462,7 +462,7 @@ virDomainObjListLoadConfig(virDomainObjListPtr doms,
|
|||
|
||||
if ((configFile = virDomainConfigFile(configDir, name)) == NULL)
|
||||
goto error;
|
||||
if (!(def = virDomainDefParseFile(configFile, caps, xmlopt,
|
||||
if (!(def = virDomainDefParseFile(configFile, caps, xmlopt, NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||
VIR_DOMAIN_DEF_PARSE_SKIP_OSTYPE_CHECKS |
|
||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
|
||||
|
|
|
@ -2831,7 +2831,7 @@ esxConnectDomainXMLToNative(virConnectPtr conn, const char *nativeFormat,
|
|||
return NULL;
|
||||
|
||||
def = virDomainDefParseString(domainXml, priv->caps, priv->xmlopt,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE);
|
||||
NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE);
|
||||
|
||||
if (!def)
|
||||
return NULL;
|
||||
|
@ -3046,7 +3046,7 @@ esxDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags)
|
|||
|
||||
/* Parse domain XML */
|
||||
def = virDomainDefParseString(xml, priv->caps, priv->xmlopt,
|
||||
parse_flags);
|
||||
NULL, parse_flags);
|
||||
|
||||
if (!def)
|
||||
return NULL;
|
||||
|
|
|
@ -677,7 +677,7 @@ libxlDomainSaveImageOpen(libxlDriverPrivatePtr driver,
|
|||
goto error;
|
||||
}
|
||||
|
||||
if (!(def = virDomainDefParseString(xml, cfg->caps, driver->xmlopt,
|
||||
if (!(def = virDomainDefParseString(xml, cfg->caps, driver->xmlopt, NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
|
||||
goto error;
|
||||
|
|
|
@ -1027,7 +1027,7 @@ libxlDomainCreateXML(virConnectPtr conn, const char *xml,
|
|||
parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
|
||||
|
||||
if (!(def = virDomainDefParseString(xml, cfg->caps, driver->xmlopt,
|
||||
parse_flags)))
|
||||
NULL, parse_flags)))
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainCreateXMLEnsureACL(conn, def) < 0)
|
||||
|
@ -2655,7 +2655,7 @@ libxlConnectDomainXMLToNative(virConnectPtr conn, const char * nativeFormat,
|
|||
goto cleanup;
|
||||
|
||||
if (!(def = virDomainDefParseString(domainXml,
|
||||
cfg->caps, driver->xmlopt,
|
||||
cfg->caps, driver->xmlopt, NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
|
||||
goto cleanup;
|
||||
|
||||
|
@ -2781,7 +2781,7 @@ libxlDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flag
|
|||
parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
|
||||
|
||||
if (!(def = virDomainDefParseString(xml, cfg->caps, driver->xmlopt,
|
||||
parse_flags)))
|
||||
NULL, parse_flags)))
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainDefineXMLFlagsEnsureACL(conn, def) < 0)
|
||||
|
|
|
@ -419,6 +419,7 @@ libxlDomainMigrationBegin(virConnectPtr conn,
|
|||
if (xmlin) {
|
||||
if (!(tmpdef = virDomainDefParseString(xmlin, cfg->caps,
|
||||
driver->xmlopt,
|
||||
NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
|
||||
goto endjob;
|
||||
|
@ -463,6 +464,7 @@ libxlDomainMigrationPrepareDef(libxlDriverPrivatePtr driver,
|
|||
}
|
||||
|
||||
if (!(def = virDomainDefParseString(dom_xml, cfg->caps, driver->xmlopt,
|
||||
NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
|
||||
goto cleanup;
|
||||
|
@ -544,6 +546,7 @@ libxlDomainMigrationPrepare(virConnectPtr dconn,
|
|||
|
||||
VIR_DEBUG("Using hook-filtered domain XML: %s", xmlout);
|
||||
newdef = virDomainDefParseString(xmlout, cfg->caps, driver->xmlopt,
|
||||
NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
|
||||
if (!newdef)
|
||||
|
|
|
@ -472,7 +472,7 @@ lxcDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags)
|
|||
goto cleanup;
|
||||
|
||||
if (!(def = virDomainDefParseString(xml, caps, driver->xmlopt,
|
||||
parse_flags)))
|
||||
NULL, parse_flags)))
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainDefineXMLFlagsEnsureACL(conn, def) < 0)
|
||||
|
@ -1225,7 +1225,7 @@ lxcDomainCreateXMLWithFiles(virConnectPtr conn,
|
|||
goto cleanup;
|
||||
|
||||
if (!(def = virDomainDefParseString(xml, caps, driver->xmlopt,
|
||||
parse_flags)))
|
||||
NULL, parse_flags)))
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainCreateXMLWithFilesEnsureACL(conn, def) < 0)
|
||||
|
|
|
@ -996,7 +996,7 @@ openvzDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int fla
|
|||
|
||||
openvzDriverLock(driver);
|
||||
if ((vmdef = virDomainDefParseString(xml, driver->caps, driver->xmlopt,
|
||||
parse_flags)) == NULL)
|
||||
NULL, parse_flags)) == NULL)
|
||||
goto cleanup;
|
||||
|
||||
if (!(vm = virDomainObjListAdd(driver->domains, vmdef,
|
||||
|
@ -1086,7 +1086,7 @@ openvzDomainCreateXML(virConnectPtr conn, const char *xml,
|
|||
|
||||
openvzDriverLock(driver);
|
||||
if ((vmdef = virDomainDefParseString(xml, driver->caps, driver->xmlopt,
|
||||
parse_flags)) == NULL)
|
||||
NULL, parse_flags)) == NULL)
|
||||
goto cleanup;
|
||||
|
||||
if (!(vm = virDomainObjListAdd(driver->domains,
|
||||
|
@ -2317,6 +2317,7 @@ openvzDomainMigratePrepare3Params(virConnectPtr dconn,
|
|||
}
|
||||
|
||||
if (!(def = virDomainDefParseString(dom_xml, driver->caps, driver->xmlopt,
|
||||
NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
|
||||
goto error;
|
||||
|
|
|
@ -3576,6 +3576,7 @@ phypDomainCreateXML(virConnectPtr conn,
|
|||
|
||||
if (!(def = virDomainDefParseString(xml, phyp_driver->caps,
|
||||
phyp_driver->xmlopt,
|
||||
NULL,
|
||||
parse_flags)))
|
||||
goto err;
|
||||
|
||||
|
|
|
@ -3364,7 +3364,7 @@ qemuDomainDefCopy(virQEMUDriverPtr driver,
|
|||
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
|
||||
goto cleanup;
|
||||
|
||||
if (!(ret = virDomainDefParseString(xml, caps, driver->xmlopt,
|
||||
if (!(ret = virDomainDefParseString(xml, caps, driver->xmlopt, NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
|
||||
goto cleanup;
|
||||
|
|
|
@ -1751,7 +1751,7 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn,
|
|||
goto cleanup;
|
||||
|
||||
if (!(def = virDomainDefParseString(xml, caps, driver->xmlopt,
|
||||
parse_flags)))
|
||||
NULL, parse_flags)))
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainCreateXMLEnsureACL(conn, def) < 0)
|
||||
|
@ -3185,7 +3185,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver, virDomainPtr dom,
|
|||
if (xmlin) {
|
||||
virDomainDefPtr def = NULL;
|
||||
|
||||
if (!(def = virDomainDefParseString(xmlin, caps, driver->xmlopt,
|
||||
if (!(def = virDomainDefParseString(xmlin, caps, driver->xmlopt, NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE))) {
|
||||
goto endjob;
|
||||
|
@ -6306,7 +6306,7 @@ qemuDomainSaveImageUpdateDef(virQEMUDriverPtr driver,
|
|||
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
|
||||
goto cleanup;
|
||||
|
||||
if (!(newdef = virDomainDefParseString(newxml, caps, driver->xmlopt,
|
||||
if (!(newdef = virDomainDefParseString(newxml, caps, driver->xmlopt, NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
|
||||
goto cleanup;
|
||||
|
||||
|
@ -6462,7 +6462,7 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
|
|||
}
|
||||
|
||||
/* Create a domain from this XML */
|
||||
if (!(def = virDomainDefParseString(xml, caps, driver->xmlopt,
|
||||
if (!(def = virDomainDefParseString(xml, caps, driver->xmlopt, NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
|
||||
goto error;
|
||||
|
@ -7014,7 +7014,7 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
|
|||
if (!(vm = virDomainObjNew(driver->xmlopt)))
|
||||
goto cleanup;
|
||||
|
||||
if (!(vm->def = virDomainDefParseString(xmlData, caps, driver->xmlopt,
|
||||
if (!(vm->def = virDomainDefParseString(xmlData, caps, driver->xmlopt, NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE)))
|
||||
goto cleanup;
|
||||
|
@ -7252,7 +7252,7 @@ qemuDomainDefineXMLFlags(virConnectPtr conn,
|
|||
goto cleanup;
|
||||
|
||||
if (!(def = virDomainDefParseString(xml, caps, driver->xmlopt,
|
||||
parse_flags)))
|
||||
NULL, parse_flags)))
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainDefineXMLFlagsEnsureACL(conn, def) < 0)
|
||||
|
@ -14596,7 +14596,7 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
|
|||
/* Easiest way to clone inactive portion of vm->def is via
|
||||
* conversion in and back out of xml. */
|
||||
if (!(xml = qemuDomainDefFormatLive(driver, vm->def, true, true)) ||
|
||||
!(def->dom = virDomainDefParseString(xml, caps, driver->xmlopt,
|
||||
!(def->dom = virDomainDefParseString(xml, caps, driver->xmlopt, NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
|
||||
goto endjob;
|
||||
|
|
|
@ -3242,7 +3242,7 @@ qemuMigrationBeginPhase(virQEMUDriverPtr driver,
|
|||
}
|
||||
|
||||
if (xmlin) {
|
||||
if (!(def = virDomainDefParseString(xmlin, caps, driver->xmlopt,
|
||||
if (!(def = virDomainDefParseString(xmlin, caps, driver->xmlopt, NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
|
||||
goto cleanup;
|
||||
|
@ -3664,7 +3664,7 @@ qemuMigrationPrepareAny(virQEMUDriverPtr driver,
|
|||
virDomainDefPtr newdef;
|
||||
|
||||
VIR_DEBUG("Using hook-filtered domain XML: %s", xmlout);
|
||||
newdef = virDomainDefParseString(xmlout, caps, driver->xmlopt,
|
||||
newdef = virDomainDefParseString(xmlout, caps, driver->xmlopt, NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
|
||||
if (!newdef)
|
||||
|
@ -4144,7 +4144,7 @@ qemuMigrationPrepareDef(virQEMUDriverPtr driver,
|
|||
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
|
||||
return NULL;
|
||||
|
||||
if (!(def = virDomainDefParseString(dom_xml, caps, driver->xmlopt,
|
||||
if (!(def = virDomainDefParseString(dom_xml, caps, driver->xmlopt, NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
|
||||
goto cleanup;
|
||||
|
|
|
@ -704,7 +704,7 @@ get_definition(vahControl * ctl, const char *xmlStr)
|
|||
}
|
||||
|
||||
ctl->def = virDomainDefParseString(xmlStr,
|
||||
ctl->caps, ctl->xmlopt,
|
||||
ctl->caps, ctl->xmlopt, NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
|
||||
|
||||
if (ctl->def == NULL) {
|
||||
|
|
|
@ -1609,7 +1609,7 @@ testDomainCreateXML(virConnectPtr conn, const char *xml,
|
|||
|
||||
testDriverLock(privconn);
|
||||
if ((def = virDomainDefParseString(xml, privconn->caps, privconn->xmlopt,
|
||||
parse_flags)) == NULL)
|
||||
NULL, parse_flags)) == NULL)
|
||||
goto cleanup;
|
||||
|
||||
if (testDomainGenerateIfnames(def) < 0)
|
||||
|
@ -2118,7 +2118,7 @@ testDomainRestoreFlags(virConnectPtr conn,
|
|||
xml[len] = '\0';
|
||||
|
||||
def = virDomainDefParseString(xml, privconn->caps, privconn->xmlopt,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE);
|
||||
NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE);
|
||||
if (!def)
|
||||
goto cleanup;
|
||||
|
||||
|
@ -2615,7 +2615,7 @@ static virDomainPtr testDomainDefineXMLFlags(virConnectPtr conn,
|
|||
parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
|
||||
|
||||
if ((def = virDomainDefParseString(xml, privconn->caps, privconn->xmlopt,
|
||||
parse_flags)) == NULL)
|
||||
NULL, parse_flags)) == NULL)
|
||||
goto cleanup;
|
||||
|
||||
if (testDomainGenerateIfnames(def) < 0)
|
||||
|
|
|
@ -1589,7 +1589,7 @@ static virDomainPtr umlDomainCreateXML(virConnectPtr conn, const char *xml,
|
|||
virNWFilterReadLockFilterUpdates();
|
||||
umlDriverLock(driver);
|
||||
if (!(def = virDomainDefParseString(xml, driver->caps, driver->xmlopt,
|
||||
parse_flags)))
|
||||
NULL, parse_flags)))
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainCreateXMLEnsureACL(conn, def) < 0)
|
||||
|
@ -2070,7 +2070,7 @@ umlDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags)
|
|||
|
||||
umlDriverLock(driver);
|
||||
if (!(def = virDomainDefParseString(xml, driver->caps, driver->xmlopt,
|
||||
parse_flags)))
|
||||
NULL, parse_flags)))
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainDefineXMLFlagsEnsureACL(conn, def) < 0)
|
||||
|
|
|
@ -1874,7 +1874,7 @@ vboxDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags
|
|||
|
||||
VBOX_IID_INITIALIZE(&mchiid);
|
||||
if (!(def = virDomainDefParseString(xml, data->caps, data->xmlopt,
|
||||
parse_flags))) {
|
||||
NULL, parse_flags))) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
|
|
@ -388,7 +388,7 @@ vmwareDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int fla
|
|||
|
||||
vmwareDriverLock(driver);
|
||||
if ((vmdef = virDomainDefParseString(xml, driver->caps, driver->xmlopt,
|
||||
parse_flags)) == NULL)
|
||||
NULL, parse_flags)) == NULL)
|
||||
goto cleanup;
|
||||
|
||||
/* generate vmx file */
|
||||
|
@ -682,7 +682,7 @@ vmwareDomainCreateXML(virConnectPtr conn, const char *xml,
|
|||
vmwareDriverLock(driver);
|
||||
|
||||
if ((vmdef = virDomainDefParseString(xml, driver->caps, driver->xmlopt,
|
||||
parse_flags)) == NULL)
|
||||
NULL, parse_flags)) == NULL)
|
||||
goto cleanup;
|
||||
|
||||
/* generate vmx file */
|
||||
|
|
|
@ -850,7 +850,7 @@ vzDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags)
|
|||
parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
|
||||
|
||||
if ((def = virDomainDefParseString(xml, driver->caps, driver->xmlopt,
|
||||
parse_flags)) == NULL)
|
||||
NULL, parse_flags)) == NULL)
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainDefineXMLFlagsEnsureACL(conn, def) < 0)
|
||||
|
@ -3046,6 +3046,7 @@ vzDomainMigratePrepare3Params(virConnectPtr conn,
|
|||
goto cleanup;
|
||||
|
||||
if (!(def = virDomainDefParseString(dom_xml, driver->caps, driver->xmlopt,
|
||||
NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
|
||||
goto cleanup;
|
||||
|
||||
|
|
|
@ -765,7 +765,7 @@ xenUnifiedDomainCreateXML(virConnectPtr conn,
|
|||
parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
|
||||
|
||||
if (!(def = virDomainDefParseString(xml, priv->caps, priv->xmlopt,
|
||||
parse_flags)))
|
||||
NULL, parse_flags)))
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainCreateXMLEnsureACL(conn, def) < 0)
|
||||
|
@ -1617,6 +1617,7 @@ xenUnifiedConnectDomainXMLToNative(virConnectPtr conn,
|
|||
}
|
||||
|
||||
if (!(def = virDomainDefParseString(xmlData, priv->caps, priv->xmlopt,
|
||||
NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
|
||||
goto cleanup;
|
||||
|
||||
|
@ -1805,7 +1806,7 @@ xenUnifiedDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int
|
|||
parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
|
||||
|
||||
if (!(def = virDomainDefParseString(xml, priv->caps, priv->xmlopt,
|
||||
parse_flags)))
|
||||
NULL, parse_flags)))
|
||||
goto cleanup;
|
||||
|
||||
if (virDomainDefineXMLFlagsEnsureACL(conn, def) < 0)
|
||||
|
|
|
@ -568,6 +568,7 @@ xenapiDomainCreateXML(virConnectPtr conn,
|
|||
|
||||
virDomainDefPtr defPtr = virDomainDefParseString(xmlDesc,
|
||||
priv->caps, priv->xmlopt,
|
||||
NULL,
|
||||
parse_flags);
|
||||
if (!defPtr)
|
||||
return NULL;
|
||||
|
@ -1752,6 +1753,7 @@ xenapiDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int fla
|
|||
return NULL;
|
||||
virDomainDefPtr defPtr = virDomainDefParseString(xml,
|
||||
priv->caps, priv->xmlopt,
|
||||
NULL,
|
||||
parse_flags);
|
||||
if (!defPtr)
|
||||
return NULL;
|
||||
|
|
|
@ -35,7 +35,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
|
|||
goto out;
|
||||
|
||||
if (!(vmdef = virDomainDefParseFile(xml, driver.caps, driver.xmlopt,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE))) {
|
||||
NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE))) {
|
||||
if (flags & FLAG_EXPECT_PARSE_ERROR)
|
||||
ret = 0;
|
||||
goto out;
|
||||
|
|
|
@ -52,7 +52,7 @@ static int testGetFilesystem(const void *opaque)
|
|||
abs_srcdir, data->filename) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!(def = virDomainDefParseFile(filename, caps, xmlopt, 0)))
|
||||
if (!(def = virDomainDefParseFile(filename, caps, xmlopt, NULL, 0)))
|
||||
goto cleanup;
|
||||
|
||||
fsdef = virDomainGetFilesystemForTarget(def,
|
||||
|
|
|
@ -182,7 +182,7 @@ testQemuAgentGetFSInfo(const void *data)
|
|||
goto cleanup;
|
||||
|
||||
if (!(def = virDomainDefParseFile(domain_filename, caps, xmlopt,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
|
||||
NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE)))
|
||||
goto cleanup;
|
||||
|
||||
if (qemuMonitorTestAddAgentSyncResponse(test) < 0)
|
||||
|
|
|
@ -84,6 +84,7 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt,
|
|||
if (!((*vm)->def = virDomainDefParseString(domxml,
|
||||
driver.caps,
|
||||
driver.xmlopt,
|
||||
NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
|
||||
goto cleanup;
|
||||
|
||||
|
|
|
@ -424,7 +424,7 @@ testCompareXMLToArgv(const void *data)
|
|||
|
||||
parseFlags |= VIR_DOMAIN_DEF_PARSE_INACTIVE;
|
||||
if (!(vm->def = virDomainDefParseFile(xml, driver.caps, driver.xmlopt,
|
||||
parseFlags))) {
|
||||
NULL, parseFlags))) {
|
||||
if (flags & FLAG_EXPECT_PARSE_ERROR)
|
||||
goto ok;
|
||||
goto cleanup;
|
||||
|
|
|
@ -189,7 +189,7 @@ testSELinuxLoadDef(const char *testname)
|
|||
abs_srcdir, testname) < 0)
|
||||
goto cleanup;
|
||||
|
||||
if (!(def = virDomainDefParseFile(xmlfile, caps, driver.xmlopt, 0)))
|
||||
if (!(def = virDomainDefParseFile(xmlfile, caps, driver.xmlopt, NULL, 0)))
|
||||
goto cleanup;
|
||||
|
||||
for (i = 0; i < def->ndisks; i++) {
|
||||
|
|
|
@ -1127,7 +1127,7 @@ testCompareDomXML2XMLFiles(virCapsPtr caps, virDomainXMLOptionPtr xmlopt,
|
|||
if (!live)
|
||||
format_flags |= VIR_DOMAIN_DEF_FORMAT_INACTIVE;
|
||||
|
||||
if (!(def = virDomainDefParseFile(infile, caps, xmlopt, parse_flags))) {
|
||||
if (!(def = virDomainDefParseFile(infile, caps, xmlopt, NULL, parse_flags))) {
|
||||
result = TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE;
|
||||
goto out;
|
||||
}
|
||||
|
|
|
@ -89,11 +89,11 @@ testCompareParseXML(const char *xlcfg, const char *xml, bool replaceVars)
|
|||
if (!(replacedXML = testReplaceVarsXML(xml)))
|
||||
goto fail;
|
||||
if (!(def = virDomainDefParseString(replacedXML, caps, xmlopt,
|
||||
VIR_DOMAIN_XML_INACTIVE)))
|
||||
NULL, VIR_DOMAIN_XML_INACTIVE)))
|
||||
goto fail;
|
||||
} else {
|
||||
if (!(def = virDomainDefParseFile(xml, caps, xmlopt,
|
||||
VIR_DOMAIN_XML_INACTIVE)))
|
||||
NULL, VIR_DOMAIN_XML_INACTIVE)))
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ testCompareParseXML(const char *xmcfg, const char *xml)
|
|||
priv.caps = caps;
|
||||
conn->privateData = &priv;
|
||||
|
||||
if (!(def = virDomainDefParseFile(xml, caps, xmlopt,
|
||||
if (!(def = virDomainDefParseFile(xml, caps, xmlopt, NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
|
||||
goto fail;
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ testCompareFiles(const char *xml, const char *sexpr)
|
|||
int ret = -1;
|
||||
virDomainDefPtr def = NULL;
|
||||
|
||||
if (!(def = virDomainDefParseFile(xml, caps, xmlopt,
|
||||
if (!(def = virDomainDefParseFile(xml, caps, xmlopt, NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
|
||||
goto fail;
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ testCompareFiles(const char *xml, const char *vmx, int virtualHW_version)
|
|||
char *formatted = NULL;
|
||||
virDomainDefPtr def = NULL;
|
||||
|
||||
def = virDomainDefParseFile(xml, caps, xmlopt,
|
||||
def = virDomainDefParseFile(xml, caps, xmlopt, NULL,
|
||||
VIR_DOMAIN_DEF_PARSE_INACTIVE);
|
||||
|
||||
if (def == NULL)
|
||||
|
|
Loading…
Reference in New Issue