conf: drop virCapsPtr param from domain parse APIs

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé 2019-11-27 12:29:21 +00:00
parent b5f591cdb4
commit bf9d812956
38 changed files with 97 additions and 175 deletions

View File

@ -519,7 +519,7 @@ bhyveDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flag
if (!caps)
return NULL;
if ((def = virDomainDefParseString(xml, caps, privconn->xmlopt,
if ((def = virDomainDefParseString(xml, privconn->xmlopt,
NULL, parse_flags)) == NULL)
goto cleanup;
@ -681,7 +681,6 @@ bhyveConnectDomainXMLToNative(virConnectPtr conn,
bhyveConnPtr privconn = conn->privateData;
virDomainDefPtr def = NULL;
virCommandPtr cmd = NULL, loadcmd = NULL;
virCapsPtr caps = NULL;
char *ret = NULL;
virCheckFlags(0, NULL);
@ -695,10 +694,7 @@ bhyveConnectDomainXMLToNative(virConnectPtr conn,
goto cleanup;
}
if (!(caps = bhyveDriverGetCapabilities(privconn)))
goto cleanup;
if (!(def = virDomainDefParseString(xmlData, caps, privconn->xmlopt,
if (!(def = virDomainDefParseString(xmlData, privconn->xmlopt,
NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE)))
goto cleanup;
@ -741,7 +737,6 @@ bhyveConnectDomainXMLToNative(virConnectPtr conn,
virCommandFree(loadcmd);
virCommandFree(cmd);
virDomainDefFree(def);
virObjectUnref(caps);
return ret;
}
@ -898,7 +893,6 @@ bhyveDomainCreateXML(virConnectPtr conn,
virDomainDefPtr def = NULL;
virDomainObjPtr vm = NULL;
virObjectEventPtr event = NULL;
virCapsPtr caps = NULL;
unsigned int start_flags = 0;
unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE;
@ -910,11 +904,7 @@ bhyveDomainCreateXML(virConnectPtr conn,
if (flags & VIR_DOMAIN_START_AUTODESTROY)
start_flags |= VIR_BHYVE_PROCESS_START_AUTODESTROY;
caps = bhyveDriverGetCapabilities(privconn);
if (!caps)
return NULL;
if ((def = virDomainDefParseString(xml, caps, privconn->xmlopt,
if ((def = virDomainDefParseString(xml, privconn->xmlopt,
NULL, parse_flags)) == NULL)
goto cleanup;
@ -947,7 +937,6 @@ bhyveDomainCreateXML(virConnectPtr conn,
dom = virGetDomain(conn, vm->def->name, vm->def->uuid, vm->def->id);
cleanup:
virObjectUnref(caps);
virDomainDefFree(def);
virDomainObjEndAPI(&vm);
virObjectEventStateQueue(privconn->domainEventState, event);

View File

@ -121,7 +121,7 @@ virDomainCheckpointDiskDefParseXML(xmlNodePtr node,
*/
static virDomainCheckpointDefPtr
virDomainCheckpointDefParse(xmlXPathContextPtr ctxt,
virCapsPtr caps,
virCapsPtr caps G_GNUC_UNUSED,
virDomainXMLOptionPtr xmlopt,
void *parseOpaque,
unsigned int flags)
@ -170,7 +170,7 @@ virDomainCheckpointDefParse(xmlXPathContextPtr ctxt,
return NULL;
}
def->parent.dom = virDomainDefParseNode(ctxt->node->doc, domainNode,
caps, xmlopt, parseOpaque,
xmlopt, parseOpaque,
domainflags);
if (!def->parent.dom)
return NULL;

View File

@ -16419,7 +16419,6 @@ virDomainVsockDefParseXML(virDomainXMLOptionPtr xmlopt,
virDomainDeviceDefPtr
virDomainDeviceDefParse(const char *xmlStr,
const virDomainDef *def,
virCapsPtr caps G_GNUC_UNUSED,
virDomainXMLOptionPtr xmlopt,
void *parseOpaque,
unsigned int flags)
@ -19773,7 +19772,6 @@ virDomainMemorytuneDefParse(virDomainDefPtr def,
static virDomainDefPtr
virDomainDefParseXML(xmlDocPtr xml,
xmlXPathContextPtr ctxt,
virCapsPtr caps G_GNUC_UNUSED,
virDomainXMLOptionPtr xmlopt,
unsigned int flags)
{
@ -21478,7 +21476,6 @@ virDomainDefParseXML(xmlDocPtr xml,
static virDomainObjPtr
virDomainObjParseXML(xmlDocPtr xml,
xmlXPathContextPtr ctxt,
virCapsPtr caps,
virDomainXMLOptionPtr xmlopt,
unsigned int flags)
{
@ -21505,7 +21502,7 @@ virDomainObjParseXML(xmlDocPtr xml,
oldnode = ctxt->node;
ctxt->node = config;
obj->def = virDomainDefParseXML(xml, ctxt, caps, xmlopt, flags);
obj->def = virDomainDefParseXML(xml, ctxt, xmlopt, flags);
ctxt->node = oldnode;
if (!obj->def)
goto error;
@ -21582,7 +21579,6 @@ virDomainObjParseXML(xmlDocPtr xml,
static virDomainDefPtr
virDomainDefParse(const char *xmlStr,
const char *filename,
virCapsPtr caps,
virDomainXMLOptionPtr xmlopt,
void *parseOpaque,
unsigned int flags)
@ -21604,7 +21600,7 @@ virDomainDefParse(const char *xmlStr,
goto cleanup;
}
def = virDomainDefParseNode(xml, root, caps, xmlopt, parseOpaque, flags);
def = virDomainDefParseNode(xml, root, xmlopt, parseOpaque, flags);
cleanup:
xmlFreeDoc(xml);
@ -21614,29 +21610,26 @@ virDomainDefParse(const char *xmlStr,
virDomainDefPtr
virDomainDefParseString(const char *xmlStr,
virCapsPtr caps,
virDomainXMLOptionPtr xmlopt,
void *parseOpaque,
unsigned int flags)
{
return virDomainDefParse(xmlStr, NULL, caps, xmlopt, parseOpaque, flags);
return virDomainDefParse(xmlStr, NULL, xmlopt, parseOpaque, flags);
}
virDomainDefPtr
virDomainDefParseFile(const char *filename,
virCapsPtr caps,
virDomainXMLOptionPtr xmlopt,
void *parseOpaque,
unsigned int flags)
{
return virDomainDefParse(NULL, filename, caps, xmlopt, parseOpaque, flags);
return virDomainDefParse(NULL, filename, xmlopt, parseOpaque, flags);
}
virDomainDefPtr
virDomainDefParseNode(xmlDocPtr xml,
xmlNodePtr root,
virCapsPtr caps,
virDomainXMLOptionPtr xmlopt,
void *parseOpaque,
unsigned int flags)
@ -21649,7 +21642,7 @@ virDomainDefParseNode(xmlDocPtr xml,
ctxt->node = root;
if (!(def = virDomainDefParseXML(xml, ctxt, caps, xmlopt, flags)))
if (!(def = virDomainDefParseXML(xml, ctxt, xmlopt, flags)))
return NULL;
/* callback to fill driver specific domain aspects */
@ -21667,7 +21660,6 @@ virDomainDefParseNode(xmlDocPtr xml,
virDomainObjPtr
virDomainObjParseNode(xmlDocPtr xml,
xmlNodePtr root,
virCapsPtr caps,
virDomainXMLOptionPtr xmlopt,
unsigned int flags)
{
@ -21685,13 +21677,12 @@ virDomainObjParseNode(xmlDocPtr xml,
return NULL;
ctxt->node = root;
return virDomainObjParseXML(xml, ctxt, caps, xmlopt, flags);
return virDomainObjParseXML(xml, ctxt, xmlopt, flags);
}
virDomainObjPtr
virDomainObjParseFile(const char *filename,
virCapsPtr caps,
virDomainXMLOptionPtr xmlopt,
unsigned int flags)
{
@ -21701,7 +21692,7 @@ virDomainObjParseFile(const char *filename,
if ((xml = virXMLParseFile(filename))) {
obj = virDomainObjParseNode(xml, xmlDocGetRootElement(xml),
caps, xmlopt, flags);
xmlopt, flags);
xmlFreeDoc(xml);
}
@ -29378,7 +29369,7 @@ virDomainDefCopy(virDomainDefPtr src,
if (!(xml = virDomainDefFormat(src, xmlopt, format_flags)))
return NULL;
return virDomainDefParseString(xml, caps, xmlopt, parseOpaque, parse_flags);
return virDomainDefParseString(xml, xmlopt, parseOpaque, parse_flags);
}
virDomainDefPtr
@ -29835,7 +29826,7 @@ virDomainNetFindByName(virDomainDefPtr def,
virDomainDeviceDefPtr
virDomainDeviceDefCopy(virDomainDeviceDefPtr src,
const virDomainDef *def,
virCapsPtr caps,
virCapsPtr caps G_GNUC_UNUSED,
virDomainXMLOptionPtr xmlopt,
void *parseOpaque)
{
@ -29923,7 +29914,7 @@ virDomainDeviceDefCopy(virDomainDeviceDefPtr src,
return NULL;
xmlStr = virBufferContentAndReset(&buf);
return virDomainDeviceDefParse(xmlStr, def, caps, xmlopt, parseOpaque,
return virDomainDeviceDefParse(xmlStr, def, xmlopt, parseOpaque,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
}

View File

@ -3035,7 +3035,6 @@ typedef enum {
virDomainDeviceDefPtr virDomainDeviceDefParse(const char *xmlStr,
const virDomainDef *def,
virCapsPtr caps,
virDomainXMLOptionPtr xmlopt,
void *parseOpaque,
unsigned int flags);
@ -3043,28 +3042,23 @@ virDomainDiskDefPtr virDomainDiskDefParse(const char *xmlStr,
virDomainXMLOptionPtr xmlopt,
unsigned int flags);
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,
virCapsPtr caps,
virDomainXMLOptionPtr xmlopt,
void *parseOpaque,
unsigned int flags);
virDomainObjPtr virDomainObjParseNode(xmlDocPtr xml,
xmlNodePtr root,
virCapsPtr caps,
virDomainXMLOptionPtr xmlopt,
unsigned int flags);
virDomainObjPtr virDomainObjParseFile(const char *filename,
virCapsPtr caps,
virDomainXMLOptionPtr xmlopt,
unsigned int flags);

View File

@ -222,7 +222,7 @@ virDomainSnapshotDiskDefParseXML(xmlNodePtr node,
*/
static virDomainSnapshotDefPtr
virDomainSnapshotDefParse(xmlXPathContextPtr ctxt,
virCapsPtr caps,
virCapsPtr caps G_GNUC_UNUSED,
virDomainXMLOptionPtr xmlopt,
void *parseOpaque,
bool *current,
@ -301,7 +301,7 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt,
goto cleanup;
}
def->parent.dom = virDomainDefParseNode(ctxt->node->doc, domainNode,
caps, xmlopt, parseOpaque,
xmlopt, parseOpaque,
domainflags);
if (!def->parent.dom)
goto cleanup;
@ -314,7 +314,7 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt,
* parent.dom for config and live XML. */
if ((inactiveDomNode = virXPathNode("./inactiveDomain", ctxt))) {
def->parent.inactiveDom = virDomainDefParseNode(ctxt->node->doc, inactiveDomNode,
caps, xmlopt, NULL, domainflags);
xmlopt, NULL, domainflags);
if (!def->parent.inactiveDom)
goto cleanup;
}

View File

@ -483,7 +483,7 @@ virDomainObjListRename(virDomainObjListPtr doms,
static virDomainObjPtr
virDomainObjListLoadConfig(virDomainObjListPtr doms,
virCapsPtr caps,
virCapsPtr caps G_GNUC_UNUSED,
virDomainXMLOptionPtr xmlopt,
const char *configDir,
const char *autostartDir,
@ -499,7 +499,7 @@ virDomainObjListLoadConfig(virDomainObjListPtr doms,
if ((configFile = virDomainConfigFile(configDir, name)) == NULL)
goto error;
if (!(def = virDomainDefParseFile(configFile, caps, xmlopt, NULL,
if (!(def = virDomainDefParseFile(configFile, xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE |
VIR_DOMAIN_DEF_PARSE_ALLOW_POST_PARSE_FAIL)))
@ -536,7 +536,7 @@ static virDomainObjPtr
virDomainObjListLoadStatus(virDomainObjListPtr doms,
const char *statusDir,
const char *name,
virCapsPtr caps,
virCapsPtr caps G_GNUC_UNUSED,
virDomainXMLOptionPtr xmlopt,
virDomainLoadConfigNotify notify,
void *opaque)
@ -548,7 +548,7 @@ virDomainObjListLoadStatus(virDomainObjListPtr doms,
if ((statusFile = virDomainConfigFile(statusDir, name)) == NULL)
goto error;
if (!(obj = virDomainObjParseFile(statusFile, caps, xmlopt,
if (!(obj = virDomainObjParseFile(statusFile, xmlopt,
VIR_DOMAIN_DEF_PARSE_STATUS |
VIR_DOMAIN_DEF_PARSE_ACTUAL_NET |
VIR_DOMAIN_DEF_PARSE_PCI_ORIG_STATES |

View File

@ -2744,7 +2744,7 @@ esxConnectDomainXMLToNative(virConnectPtr conn, const char *nativeFormat,
if (virtualHW_version < 0)
return NULL;
def = virDomainDefParseString(domainXml, priv->caps, priv->xmlopt,
def = virDomainDefParseString(domainXml, priv->xmlopt,
NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE);
if (!def)
@ -2960,7 +2960,7 @@ esxDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags)
return NULL;
/* Parse domain XML */
def = virDomainDefParseString(xml, priv->caps, priv->xmlopt,
def = virDomainDefParseString(xml, priv->xmlopt,
NULL, parse_flags);
if (!def)

View File

@ -732,7 +732,7 @@ libxlDomainManagedSavePath(libxlDriverPrivatePtr driver, virDomainObjPtr vm)
*/
int
libxlDomainSaveImageOpen(libxlDriverPrivatePtr driver,
libxlDriverConfigPtr cfg,
libxlDriverConfigPtr cfg G_GNUC_UNUSED,
const char *from,
virDomainDefPtr *ret_def,
libxlSavefileHeaderPtr ret_hdr)
@ -780,7 +780,7 @@ libxlDomainSaveImageOpen(libxlDriverPrivatePtr driver,
goto error;
}
if (!(def = virDomainDefParseString(xml, cfg->caps, driver->xmlopt, NULL,
if (!(def = virDomainDefParseString(xml, driver->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
goto error;

View File

@ -1042,7 +1042,7 @@ libxlDomainCreateXML(virConnectPtr conn, const char *xml,
if (flags & VIR_DOMAIN_START_VALIDATE)
parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
if (!(def = virDomainDefParseString(xml, cfg->caps, driver->xmlopt,
if (!(def = virDomainDefParseString(xml, driver->xmlopt,
NULL, parse_flags)))
goto cleanup;
@ -2730,7 +2730,7 @@ libxlConnectDomainXMLToNative(virConnectPtr conn, const char * nativeFormat,
goto cleanup;
if (!(def = virDomainDefParseString(domainXml,
cfg->caps, driver->xmlopt, NULL,
driver->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
goto cleanup;
@ -2850,7 +2850,7 @@ libxlDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flag
if (flags & VIR_DOMAIN_DEFINE_VALIDATE)
parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
if (!(def = virDomainDefParseString(xml, cfg->caps, driver->xmlopt,
if (!(def = virDomainDefParseString(xml, driver->xmlopt,
NULL, parse_flags)))
goto cleanup;
@ -4116,7 +4116,7 @@ libxlDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
if (!(dev = virDomainDeviceDefParse(xml, vm->def,
cfg->caps, driver->xmlopt, NULL,
driver->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
goto endjob;
@ -4133,7 +4133,7 @@ libxlDomainAttachDeviceFlags(virDomainPtr dom, const char *xml,
/* If dev exists it was created to modify the domain config. Free it. */
virDomainDeviceDefFree(dev);
if (!(dev = virDomainDeviceDefParse(xml, vm->def,
cfg->caps, driver->xmlopt, NULL,
driver->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
goto endjob;
@ -4205,7 +4205,7 @@ libxlDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
if (!(dev = virDomainDeviceDefParse(xml, vm->def,
cfg->caps, driver->xmlopt, NULL,
driver->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
goto endjob;
@ -4223,7 +4223,7 @@ libxlDomainDetachDeviceFlags(virDomainPtr dom, const char *xml,
/* If dev exists it was created to modify the domain config. Free it. */
virDomainDeviceDefFree(dev);
if (!(dev = virDomainDeviceDefParse(xml, vm->def,
cfg->caps, driver->xmlopt, NULL,
driver->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
goto endjob;
@ -4293,7 +4293,7 @@ libxlDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml,
if (flags & VIR_DOMAIN_DEVICE_MODIFY_CONFIG) {
if (!(dev = virDomainDeviceDefParse(xml, vm->def,
cfg->caps, driver->xmlopt, NULL,
driver->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
goto cleanup;
@ -4312,7 +4312,7 @@ libxlDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml,
/* If dev exists it was created to modify the domain config. Free it. */
virDomainDeviceDefFree(dev);
if (!(dev = virDomainDeviceDefParse(xml, vm->def,
cfg->caps, driver->xmlopt, NULL,
driver->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
goto cleanup;

View File

@ -402,7 +402,7 @@ libxlDomainMigrationSrcBegin(virConnectPtr conn,
goto endjob;
if (xmlin) {
if (!(tmpdef = virDomainDefParseString(xmlin, cfg->caps,
if (!(tmpdef = virDomainDefParseString(xmlin,
driver->xmlopt,
NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
@ -450,7 +450,7 @@ libxlDomainMigrationDstPrepareDef(libxlDriverPrivatePtr driver,
return NULL;
}
if (!(def = virDomainDefParseString(dom_xml, cfg->caps, driver->xmlopt,
if (!(def = virDomainDefParseString(dom_xml, driver->xmlopt,
NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
@ -477,7 +477,6 @@ libxlDomainMigrationPrepareAny(virConnectPtr dconn,
bool *taint_hook)
{
libxlDriverPrivatePtr driver = dconn->privateData;
libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
if (libxlMigrationEatCookie(cookiein, cookieinlen, mig) < 0)
return -1;
@ -514,7 +513,7 @@ libxlDomainMigrationPrepareAny(virConnectPtr dconn,
virDomainDefPtr newdef;
VIR_DEBUG("Using hook-filtered domain XML: %s", *xmlout);
newdef = virDomainDefParseString(*xmlout, cfg->caps, driver->xmlopt,
newdef = virDomainDefParseString(*xmlout, driver->xmlopt,
NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);

View File

@ -212,7 +212,7 @@ static virLXCControllerPtr virLXCControllerNew(const char *name)
goto error;
if ((ctrl->vm = virDomainObjParseFile(configFile,
driver->caps, driver->xmlopt,
driver->xmlopt,
0)) == NULL)
goto error;
ctrl->def = ctrl->vm->def;

View File

@ -416,7 +416,7 @@ lxcDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags)
if (!(caps = virLXCDriverGetCapabilities(driver, false)))
goto cleanup;
if (!(def = virDomainDefParseString(xml, caps, driver->xmlopt,
if (!(def = virDomainDefParseString(xml, driver->xmlopt,
NULL, parse_flags)))
goto cleanup;
@ -1164,7 +1164,7 @@ lxcDomainCreateXMLWithFiles(virConnectPtr conn,
if (!(caps = virLXCDriverGetCapabilities(driver, false)))
goto cleanup;
if (!(def = virDomainDefParseString(xml, caps, driver->xmlopt,
if (!(def = virDomainDefParseString(xml, driver->xmlopt,
NULL, parse_flags)))
goto cleanup;
@ -4699,7 +4699,7 @@ static int lxcDomainAttachDeviceFlags(virDomainPtr dom,
goto endjob;
dev = dev_copy = virDomainDeviceDefParse(xml, vm->def,
caps, driver->xmlopt, NULL,
driver->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE);
if (dev == NULL)
goto endjob;
@ -4818,7 +4818,7 @@ static int lxcDomainUpdateDeviceFlags(virDomainPtr dom,
if (!(caps = virLXCDriverGetCapabilities(driver, false)))
goto endjob;
if (!(dev = virDomainDeviceDefParse(xml, vm->def, caps, driver->xmlopt, NULL,
if (!(dev = virDomainDeviceDefParse(xml, vm->def, driver->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
goto endjob;
@ -4882,7 +4882,7 @@ static int lxcDomainDetachDeviceFlags(virDomainPtr dom,
goto endjob;
dev = dev_copy = virDomainDeviceDefParse(xml, vm->def,
caps, driver->xmlopt, NULL,
driver->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
if (dev == NULL)

View File

@ -858,7 +858,7 @@ openvzDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int fla
parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
openvzDriverLock(driver);
if ((vmdef = virDomainDefParseString(xml, driver->caps, driver->xmlopt,
if ((vmdef = virDomainDefParseString(xml, driver->xmlopt,
NULL, parse_flags)) == NULL)
goto cleanup;
@ -948,7 +948,7 @@ openvzDomainCreateXML(virConnectPtr conn, const char *xml,
parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
openvzDriverLock(driver);
if ((vmdef = virDomainDefParseString(xml, driver->caps, driver->xmlopt,
if ((vmdef = virDomainDefParseString(xml, driver->xmlopt,
NULL, parse_flags)) == NULL)
goto cleanup;
@ -1909,7 +1909,7 @@ openvzDomainUpdateDeviceFlags(virDomainPtr dom, const char *xml,
if (!(def = virDomainObjGetOneDef(vm, flags)))
goto cleanup;
dev = virDomainDeviceDefParse(xml, def, driver->caps, driver->xmlopt, NULL,
dev = virDomainDeviceDefParse(xml, def, driver->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE);
if (!dev)
goto cleanup;
@ -2113,7 +2113,7 @@ openvzDomainMigratePrepare3Params(virConnectPtr dconn,
goto error;
}
if (!(def = virDomainDefParseString(dom_xml, driver->caps, driver->xmlopt,
if (!(def = virDomainDefParseString(dom_xml, driver->xmlopt,
NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))

View File

@ -1684,7 +1684,7 @@ phypDomainAttachDeviceFlags(virDomainPtr domain,
def->os.type = VIR_DOMAIN_OSTYPE_LINUX;
dev = virDomainDeviceDefParse(xml, def, phyp_driver->caps, NULL, NULL,
dev = virDomainDeviceDefParse(xml, def, NULL, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE);
if (!dev)
goto cleanup;
@ -3531,7 +3531,7 @@ phypDomainCreateXML(virConnectPtr conn,
if (flags & VIR_DOMAIN_START_VALIDATE)
parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
if (!(def = virDomainDefParseString(xml, phyp_driver->caps,
if (!(def = virDomainDefParseString(xml,
phyp_driver->xmlopt,
NULL,
parse_flags)))

View File

@ -239,7 +239,7 @@ qemuCheckpointDiscardAllMetadata(virQEMUDriverPtr driver,
/* Called inside job lock */
static int
qemuCheckpointPrepare(virQEMUDriverPtr driver,
virCapsPtr caps,
virCapsPtr caps G_GNUC_UNUSED,
virDomainObjPtr vm,
virDomainCheckpointDefPtr def)
{
@ -253,7 +253,7 @@ qemuCheckpointPrepare(virQEMUDriverPtr driver,
if (!(xml = qemuDomainDefFormatLive(driver, priv->qemuCaps,
vm->def, priv->origCPU,
true, true)) ||
!(def->parent.dom = virDomainDefParseString(xml, caps, driver->xmlopt,
!(def->parent.dom = virDomainDefParseString(xml, driver->xmlopt,
priv->qemuCaps,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))

View File

@ -8975,17 +8975,12 @@ qemuDomainDefFromXML(virQEMUDriverPtr driver,
virQEMUCapsPtr qemuCaps,
const char *xml)
{
virCapsPtr caps;
virDomainDefPtr def;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
return NULL;
def = virDomainDefParseString(xml, caps, driver->xmlopt, qemuCaps,
def = virDomainDefParseString(xml, driver->xmlopt, qemuCaps,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
virObjectUnref(caps);
return def;
}

View File

@ -1748,7 +1748,6 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn,
virObjectEventPtr event = NULL;
virObjectEventPtr event2 = NULL;
unsigned int start_flags = VIR_QEMU_PROCESS_START_COLD;
g_autoptr(virCaps) caps = NULL;
unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE;
@ -1765,10 +1764,7 @@ static virDomainPtr qemuDomainCreateXML(virConnectPtr conn,
virNWFilterReadLockFilterUpdates();
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
if (!(def = virDomainDefParseString(xml, caps, driver->xmlopt,
if (!(def = virDomainDefParseString(xml, driver->xmlopt,
NULL, parse_flags)))
goto cleanup;
@ -3277,13 +3273,9 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver,
int ret = -1;
virObjectEventPtr event = NULL;
qemuDomainObjPrivatePtr priv = vm->privateData;
g_autoptr(virCaps) caps = NULL;
virQEMUSaveDataPtr data = NULL;
qemuDomainSaveCookiePtr cookie = NULL;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
if (!qemuMigrationSrcIsAllowed(driver, vm, false, 0))
goto cleanup;
@ -3326,7 +3318,7 @@ qemuDomainSaveInternal(virQEMUDriverPtr driver,
if (xmlin) {
virDomainDefPtr def = NULL;
if (!(def = virDomainDefParseString(xmlin, caps, driver->xmlopt,
if (!(def = virDomainDefParseString(xmlin, driver->xmlopt,
priv->qemuCaps,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE))) {
@ -6581,12 +6573,8 @@ qemuDomainSaveImageUpdateDef(virQEMUDriverPtr driver,
virDomainDefPtr ret = NULL;
virDomainDefPtr newdef_migr = NULL;
virDomainDefPtr newdef = NULL;
g_autoptr(virCaps) caps = NULL;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
if (!(newdef = virDomainDefParseString(newxml, caps, driver->xmlopt, NULL,
if (!(newdef = virDomainDefParseString(newxml, driver->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
goto cleanup;
@ -6659,7 +6647,6 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
virQEMUSaveHeaderPtr header;
virDomainDefPtr def = NULL;
int oflags = open_write ? O_RDWR : O_RDONLY;
g_autoptr(virCaps) caps = NULL;
size_t xml_len;
size_t cookie_len;
@ -6673,9 +6660,6 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
oflags |= directFlag;
}
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto error;
if ((fd = qemuOpenFile(driver, NULL, path, oflags, NULL)) < 0)
goto error;
if (bypass_cache &&
@ -6770,7 +6754,7 @@ qemuDomainSaveImageOpen(virQEMUDriverPtr driver,
}
/* Create a domain from this XML */
if (!(def = virDomainDefParseString(data->xml, caps, driver->xmlopt, qemuCaps,
if (!(def = virDomainDefParseString(data->xml, driver->xmlopt, qemuCaps,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
goto error;
@ -7343,7 +7327,6 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
virCommandPtr cmd = NULL;
char *ret = NULL;
size_t i;
g_autoptr(virCaps) caps = NULL;
virCheckFlags(0, NULL);
@ -7356,13 +7339,10 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
goto cleanup;
}
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
if (!(vm = virDomainObjNew(driver->xmlopt)))
goto cleanup;
if (!(vm->def = virDomainDefParseString(xmlData, caps, driver->xmlopt, NULL,
if (!(vm->def = virDomainDefParseString(xmlData, driver->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE)))
goto cleanup;
@ -7587,7 +7567,6 @@ qemuDomainDefineXMLFlags(virConnectPtr conn,
virDomainPtr dom = NULL;
virObjectEventPtr event = NULL;
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
g_autoptr(virCaps) caps = NULL;
unsigned int parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE;
@ -7596,10 +7575,7 @@ qemuDomainDefineXMLFlags(virConnectPtr conn,
if (flags & VIR_DOMAIN_DEFINE_VALIDATE)
parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
if (!(def = virDomainDefParseString(xml, caps, driver->xmlopt,
if (!(def = virDomainDefParseString(xml, driver->xmlopt,
NULL, parse_flags)))
goto cleanup;
@ -8651,7 +8627,7 @@ qemuDomainAttachDeviceLiveAndConfig(virDomainObjPtr vm,
if (!vmdef)
goto cleanup;
if (!(devConf = virDomainDeviceDefParse(xml, vmdef, caps,
if (!(devConf = virDomainDeviceDefParse(xml, vmdef,
driver->xmlopt, priv->qemuCaps,
parse_flags)))
goto cleanup;
@ -8672,7 +8648,7 @@ qemuDomainAttachDeviceLiveAndConfig(virDomainObjPtr vm,
}
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
if (!(devLive = virDomainDeviceDefParse(xml, vm->def, caps,
if (!(devLive = virDomainDeviceDefParse(xml, vm->def,
driver->xmlopt, priv->qemuCaps,
parse_flags)))
goto cleanup;
@ -8803,7 +8779,7 @@ static int qemuDomainUpdateDeviceFlags(virDomainPtr dom,
!(flags & VIR_DOMAIN_AFFECT_LIVE))
parse_flags |= VIR_DOMAIN_DEF_PARSE_INACTIVE;
dev = dev_copy = virDomainDeviceDefParse(xml, vm->def, caps,
dev = dev_copy = virDomainDeviceDefParse(xml, vm->def,
driver->xmlopt, priv->qemuCaps,
parse_flags);
if (dev == NULL)
@ -8900,7 +8876,7 @@ qemuDomainDetachDeviceLiveAndConfig(virQEMUDriverPtr driver,
!(flags & VIR_DOMAIN_AFFECT_LIVE))
parse_flags |= VIR_DOMAIN_DEF_PARSE_INACTIVE;
dev = dev_copy = virDomainDeviceDefParse(xml, vm->def, caps,
dev = dev_copy = virDomainDeviceDefParse(xml, vm->def,
driver->xmlopt, priv->qemuCaps,
parse_flags);
if (dev == NULL)
@ -15972,7 +15948,7 @@ qemuDomainSnapshotCreateXML(virDomainPtr domain,
if (!(xml = qemuDomainDefFormatLive(driver, priv->qemuCaps,
vm->def, priv->origCPU,
true, true)) ||
!(def->parent.dom = virDomainDefParseString(xml, caps, driver->xmlopt,
!(def->parent.dom = virDomainDefParseString(xml, driver->xmlopt,
priv->qemuCaps,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))

View File

@ -1974,7 +1974,6 @@ qemuMigrationSrcBeginPhase(virQEMUDriverPtr driver,
qemuMigrationCookiePtr mig = NULL;
virDomainDefPtr def = NULL;
qemuDomainObjPrivatePtr priv = vm->privateData;
virCapsPtr caps = NULL;
unsigned int cookieFlags = QEMU_MIGRATION_COOKIE_LOCKSTATE;
VIR_DEBUG("driver=%p, vm=%p, xmlin=%s, dname=%s,"
@ -1984,9 +1983,6 @@ qemuMigrationSrcBeginPhase(virQEMUDriverPtr driver,
cookieout, cookieoutlen, nmigrate_disks,
migrate_disks, flags);
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
/* Only set the phase if we are inside QEMU_ASYNC_JOB_MIGRATION_OUT.
* Otherwise we will start the async job later in the perform phase losing
* change protection.
@ -2103,7 +2099,7 @@ qemuMigrationSrcBeginPhase(virQEMUDriverPtr driver,
}
if (xmlin) {
if (!(def = virDomainDefParseString(xmlin, caps, driver->xmlopt, priv->qemuCaps,
if (!(def = virDomainDefParseString(xmlin, driver->xmlopt, priv->qemuCaps,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
goto cleanup;
@ -2119,7 +2115,6 @@ qemuMigrationSrcBeginPhase(virQEMUDriverPtr driver,
cleanup:
qemuMigrationCookieFree(mig);
virObjectUnref(caps);
virDomainDefFree(def);
return rv;
}
@ -2318,7 +2313,6 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver,
char *xmlout = NULL;
unsigned int cookieFlags;
unsigned int startFlags;
virCapsPtr caps = NULL;
qemuProcessIncomingDefPtr incoming = NULL;
bool taint_hook = false;
bool stopProcess = false;
@ -2369,9 +2363,6 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver,
goto cleanup;
}
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto cleanup;
if (!qemuMigrationSrcIsAllowedHostdev(*def))
goto cleanup;
@ -2400,7 +2391,7 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver,
virDomainDefPtr newdef;
VIR_DEBUG("Using hook-filtered domain XML: %s", xmlout);
newdef = virDomainDefParseString(xmlout, caps, driver->xmlopt, NULL,
newdef = virDomainDefParseString(xmlout, driver->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
if (!newdef)
@ -2648,7 +2639,6 @@ qemuMigrationDstPrepareAny(virQEMUDriverPtr driver,
virDomainObjEndAPI(&vm);
virObjectEventStateQueue(driver->domainEventState, event);
qemuMigrationCookieFree(mig);
virObjectUnref(caps);
virNWFilterUnlockFilterUpdates();
virErrorRestore(&origErr);
return ret;
@ -2886,7 +2876,6 @@ qemuMigrationAnyPrepareDef(virQEMUDriverPtr driver,
const char *dname,
char **origname)
{
virCapsPtr caps = NULL;
virDomainDefPtr def;
char *name = NULL;
@ -2896,10 +2885,7 @@ qemuMigrationAnyPrepareDef(virQEMUDriverPtr driver,
return NULL;
}
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
return NULL;
if (!(def = virDomainDefParseString(dom_xml, caps, driver->xmlopt,
if (!(def = virDomainDefParseString(dom_xml, driver->xmlopt,
qemuCaps,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
@ -2911,7 +2897,6 @@ qemuMigrationAnyPrepareDef(virQEMUDriverPtr driver,
}
cleanup:
virObjectUnref(caps);
if (def && origname)
*origname = name;
else

View File

@ -1198,10 +1198,6 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
xmlNodePtr *nodes = NULL;
size_t i;
int n;
virCapsPtr caps = NULL;
if (!(caps = virQEMUDriverGetCapabilities(driver, false)))
goto error;
/* We don't store the uuid, name, hostname, or hostuuid
* values. We just compare them to local data to do some
@ -1330,7 +1326,7 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
goto error;
}
mig->persistent = virDomainDefParseNode(doc, nodes[0],
caps, driver->xmlopt, qemuCaps,
driver->xmlopt, qemuCaps,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE_MIGRATION |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
@ -1369,13 +1365,11 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
!(mig->caps = qemuMigrationCookieCapsXMLParse(ctxt)))
goto error;
virObjectUnref(caps);
return 0;
error:
VIR_FREE(tmp);
VIR_FREE(nodes);
virObjectUnref(caps);
return -1;
}

View File

@ -690,7 +690,7 @@ get_definition(vahControl * ctl, const char *xmlStr)
}
ctl->def = virDomainDefParseString(xmlStr,
ctl->caps, ctl->xmlopt, NULL,
ctl->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_SKIP_SECLABEL |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);

View File

@ -945,7 +945,7 @@ testParseDomains(testDriverPtr privconn,
goto error;
def = virDomainDefParseNode(ctxt->doc, node,
privconn->caps, privconn->xmlopt, NULL,
privconn->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE);
if (!def)
goto error;
@ -1678,7 +1678,7 @@ testDomainCreateXML(virConnectPtr conn, const char *xml,
parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
virObjectLock(privconn);
if ((def = virDomainDefParseString(xml, privconn->caps, privconn->xmlopt,
if ((def = virDomainDefParseString(xml, privconn->xmlopt,
NULL, parse_flags)) == NULL)
goto cleanup;
@ -2294,7 +2294,7 @@ testDomainSaveImageOpen(testDriverPtr driver,
}
xml[len] = '\0';
if (!(def = virDomainDefParseString(xml, driver->caps, driver->xmlopt, NULL,
if (!(def = virDomainDefParseString(xml, driver->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE)))
goto error;
@ -2437,7 +2437,7 @@ testDomainSaveImageDefineXML(virConnectPtr conn,
goto cleanup;
VIR_FORCE_CLOSE(fd);
if ((newdef = virDomainDefParseString(dxml, privconn->caps, privconn->xmlopt, NULL,
if ((newdef = virDomainDefParseString(dxml, privconn->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE)) == NULL)
goto cleanup;
@ -3989,7 +3989,7 @@ static virDomainPtr testDomainDefineXMLFlags(virConnectPtr conn,
if (flags & VIR_DOMAIN_DEFINE_VALIDATE)
parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
if ((def = virDomainDefParseString(xml, privconn->caps, privconn->xmlopt,
if ((def = virDomainDefParseString(xml, privconn->xmlopt,
NULL, parse_flags)) == NULL)
goto cleanup;

View File

@ -1858,7 +1858,7 @@ vboxDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags
if (!data->vboxObj)
return ret;
if (!(def = virDomainDefParseString(xml, data->caps, data->xmlopt,
if (!(def = virDomainDefParseString(xml, data->xmlopt,
NULL, parse_flags)))
return ret;
@ -4257,7 +4257,7 @@ static int vboxDomainAttachDeviceImpl(virDomainPtr dom,
def->os.type = VIR_DOMAIN_OSTYPE_HVM;
dev = virDomainDeviceDefParse(xml, def, data->caps, data->xmlopt, NULL,
dev = virDomainDeviceDefParse(xml, def, data->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE);
if (dev == NULL)
goto cleanup;
@ -4376,7 +4376,7 @@ static int vboxDomainDetachDevice(virDomainPtr dom, const char *xml)
def->os.type = VIR_DOMAIN_OSTYPE_HVM;
dev = virDomainDeviceDefParse(xml, def, data->caps, data->xmlopt, NULL,
dev = virDomainDeviceDefParse(xml, def, data->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE |
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
if (dev == NULL)

View File

@ -421,7 +421,7 @@ vmwareDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int fla
ctx.datacenterPath = NULL;
vmwareDriverLock(driver);
if ((vmdef = virDomainDefParseString(xml, driver->caps, driver->xmlopt,
if ((vmdef = virDomainDefParseString(xml, driver->xmlopt,
NULL, parse_flags)) == NULL)
goto cleanup;
@ -683,7 +683,7 @@ vmwareDomainCreateXML(virConnectPtr conn, const char *xml,
vmwareDriverLock(driver);
if ((vmdef = virDomainDefParseString(xml, driver->caps, driver->xmlopt,
if ((vmdef = virDomainDefParseString(xml, driver->xmlopt,
NULL, parse_flags)) == NULL)
goto cleanup;

View File

@ -792,7 +792,7 @@ vzDomainDefineXMLFlags(virConnectPtr conn, const char *xml, unsigned int flags)
if (flags & VIR_DOMAIN_DEFINE_VALIDATE)
parse_flags |= VIR_DOMAIN_DEF_PARSE_VALIDATE_SCHEMA;
if ((def = virDomainDefParseString(xml, driver->caps, driver->xmlopt,
if ((def = virDomainDefParseString(xml, driver->xmlopt,
NULL, parse_flags)) == NULL)
goto cleanup;
@ -2992,7 +2992,7 @@ vzDomainMigratePrepare3Params(virConnectPtr conn,
| VZ_MIGRATION_COOKIE_DOMAIN_NAME) < 0)
goto cleanup;
if (!(def = virDomainDefParseString(dom_xml, driver->caps, driver->xmlopt,
if (!(def = virDomainDefParseString(dom_xml, driver->xmlopt,
NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
goto cleanup;

View File

@ -35,7 +35,7 @@ static int testCompareXMLToArgvFiles(const char *xml,
if (!(conn = virGetConnect()))
goto out;
if (!(vmdef = virDomainDefParseFile(xml, driver.caps, driver.xmlopt,
if (!(vmdef = virDomainDefParseFile(xml, driver.xmlopt,
NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE))) {
if (flags & FLAG_EXPECT_PARSE_ERROR) {
ret = 0;

View File

@ -49,7 +49,7 @@ static int testGetFilesystem(const void *opaque)
filename = g_strdup_printf("%s/domainconfdata/%s.xml", abs_srcdir,
data->filename);
if (!(def = virDomainDefParseFile(filename, caps, xmlopt, NULL, 0)))
if (!(def = virDomainDefParseFile(filename, xmlopt, NULL, 0)))
goto cleanup;
fsdef = virDomainGetFilesystemForTarget(def,

View File

@ -76,7 +76,7 @@ testCompareXMLToDomConfig(const char *xmlfile,
if (!(gports = virPortAllocatorRangeNew("vnc", 5900, 6000)))
goto cleanup;
if (!(vmdef = virDomainDefParseFile(xmlfile, cfg->caps, driver->xmlopt,
if (!(vmdef = virDomainDefParseFile(xmlfile, driver->xmlopt,
NULL, VIR_DOMAIN_XML_INACTIVE)))
goto cleanup;

View File

@ -185,7 +185,7 @@ testQemuAgentGetFSInfoCommon(virDomainXMLOptionPtr xmlopt,
domain_filename = g_strdup_printf("%s/qemuagentdata/fsinfo.xml", abs_srcdir);
if (!(ret_def = virDomainDefParseFile(domain_filename, driver.caps, xmlopt,
if (!(ret_def = virDomainDefParseFile(domain_filename, xmlopt,
NULL, VIR_DOMAIN_DEF_PARSE_INACTIVE)))
goto cleanup;

View File

@ -87,7 +87,6 @@ qemuHotplugCreateObjects(virDomainXMLOptionPtr xmlopt,
return -1;
if (!((*vm)->def = virDomainDefParseString(domxml,
driver.caps,
driver.xmlopt,
NULL,
parseFlags)))
@ -277,7 +276,7 @@ testQemuHotplug(const void *data)
device_parse_flags = VIR_DOMAIN_DEF_PARSE_INACTIVE;
if (!(dev = virDomainDeviceDefParse(device_xml, vm->def,
caps, driver.xmlopt, NULL,
driver.xmlopt, NULL,
device_parse_flags)))
goto cleanup;

View File

@ -37,7 +37,7 @@ testCompareMemLock(const void *data)
xml = g_strdup_printf("%s/qemumemlockdata/qemumemlock-%s.xml", abs_srcdir,
info->name);
if (!(def = virDomainDefParseFile(xml, driver.caps, driver.xmlopt, NULL,
if (!(def = virDomainDefParseFile(xml, driver.xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE))) {
goto cleanup;
}

View File

@ -68,7 +68,6 @@ prepareObjects(virQEMUDriverPtr driver,
return -1;
if (!(vm->def = virDomainDefParseString(domxml,
driver->caps,
driver->xmlopt,
NULL,
0)))

View File

@ -450,7 +450,7 @@ testCompareXMLToArgv(const void *data)
parseFlags |= VIR_DOMAIN_DEF_PARSE_INACTIVE;
if (!(vm->def = virDomainDefParseFile(info->infile,
driver.caps, driver.xmlopt,
driver.xmlopt,
NULL, parseFlags))) {
if (flags & FLAG_EXPECT_PARSE_ERROR)
goto ok;

View File

@ -58,7 +58,7 @@ testCompareStatusXMLToXMLFiles(const void *opaque)
char *actual = NULL;
int ret = -1;
if (!(obj = virDomainObjParseFile(data->infile, driver.caps, driver.xmlopt,
if (!(obj = virDomainObjParseFile(data->infile, driver.xmlopt,
VIR_DOMAIN_DEF_PARSE_STATUS |
VIR_DOMAIN_DEF_PARSE_ACTUAL_NET |
VIR_DOMAIN_DEF_PARSE_PCI_ORIG_STATES |

View File

@ -175,7 +175,7 @@ testSELinuxLoadDef(const char *testname)
xmlfile = g_strdup_printf("%s/securityselinuxlabeldata/%s.xml", abs_srcdir,
testname);
if (!(def = virDomainDefParseFile(xmlfile, driver.caps, driver.xmlopt,
if (!(def = virDomainDefParseFile(xmlfile, driver.xmlopt,
NULL, 0)))
goto cleanup;

View File

@ -1107,7 +1107,8 @@ virDomainXMLOptionPtr virTestGenericDomainXMLConfInit(void)
int
testCompareDomXML2XMLFiles(virCapsPtr caps, virDomainXMLOptionPtr xmlopt,
testCompareDomXML2XMLFiles(virCapsPtr caps G_GNUC_UNUSED,
virDomainXMLOptionPtr xmlopt,
const char *infile, const char *outfile, bool live,
unsigned int parseFlags,
testCompareDomXML2XMLResult expectResult)
@ -1129,7 +1130,7 @@ testCompareDomXML2XMLFiles(virCapsPtr caps, virDomainXMLOptionPtr xmlopt,
if (!live)
format_flags |= VIR_DOMAIN_DEF_FORMAT_INACTIVE;
if (!(def = virDomainDefParseFile(infile, caps, xmlopt, NULL, parse_flags))) {
if (!(def = virDomainDefParseFile(infile, xmlopt, NULL, parse_flags))) {
result = TEST_COMPARE_DOM_XML2XML_RESULT_FAIL_PARSE;
goto out;
}

View File

@ -83,11 +83,11 @@ testCompareParseXML(const char *xlcfg, const char *xml, bool replaceVars)
if (replaceVars) {
if (!(replacedXML = testReplaceVarsXML(xml)))
goto fail;
if (!(def = virDomainDefParseString(replacedXML, cfg->caps, driver->xmlopt,
if (!(def = virDomainDefParseString(replacedXML, driver->xmlopt,
NULL, VIR_DOMAIN_XML_INACTIVE)))
goto fail;
} else {
if (!(def = virDomainDefParseFile(xml, cfg->caps, driver->xmlopt,
if (!(def = virDomainDefParseFile(xml, driver->xmlopt,
NULL, VIR_DOMAIN_XML_INACTIVE)))
goto fail;
}

View File

@ -53,7 +53,7 @@ testCompareParseXML(const char *xmcfg, const char *xml)
conn = virGetConnect();
if (!conn) goto fail;
if (!(def = virDomainDefParseFile(xml, cfg->caps, driver->xmlopt, NULL,
if (!(def = virDomainDefParseFile(xml, driver->xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
goto fail;

View File

@ -74,7 +74,7 @@ testCompareFiles(const char *xml, const char *vmx, int virtualHW_version)
char *formatted = NULL;
virDomainDefPtr def = NULL;
def = virDomainDefParseFile(xml, caps, xmlopt, NULL,
def = virDomainDefParseFile(xml, xmlopt, NULL,
VIR_DOMAIN_DEF_PARSE_INACTIVE);
if (def == NULL)