mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-26 23:55:23 +00:00
virDomainDefParseNode: Introduce @parseOpaque argument
We want to pass the proper opaque pointer instead of NULL to virDomainDefParseXML and subsequently virDomainDefPostParse too. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
940d91c55b
commit
da6c604af2
@ -15977,6 +15977,7 @@ virDomainDefParseXML(xmlDocPtr xml,
|
|||||||
xmlXPathContextPtr ctxt,
|
xmlXPathContextPtr ctxt,
|
||||||
virCapsPtr caps,
|
virCapsPtr caps,
|
||||||
virDomainXMLOptionPtr xmlopt,
|
virDomainXMLOptionPtr xmlopt,
|
||||||
|
void *parseOpaque,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
xmlNodePtr *nodes = NULL, node = NULL;
|
xmlNodePtr *nodes = NULL, node = NULL;
|
||||||
@ -17628,7 +17629,7 @@ virDomainDefParseXML(xmlDocPtr xml,
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
/* callback to fill driver specific domain aspects */
|
/* callback to fill driver specific domain aspects */
|
||||||
if (virDomainDefPostParse(def, caps, flags, xmlopt, NULL) < 0)
|
if (virDomainDefPostParse(def, caps, flags, xmlopt, parseOpaque) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
/* valdiate configuration */
|
/* valdiate configuration */
|
||||||
@ -17677,7 +17678,7 @@ virDomainObjParseXML(xmlDocPtr xml,
|
|||||||
|
|
||||||
oldnode = ctxt->node;
|
oldnode = ctxt->node;
|
||||||
ctxt->node = config;
|
ctxt->node = config;
|
||||||
obj->def = virDomainDefParseXML(xml, config, ctxt, caps, xmlopt, flags);
|
obj->def = virDomainDefParseXML(xml, config, ctxt, caps, xmlopt, NULL, flags);
|
||||||
ctxt->node = oldnode;
|
ctxt->node = oldnode;
|
||||||
if (!obj->def)
|
if (!obj->def)
|
||||||
goto error;
|
goto error;
|
||||||
@ -17758,7 +17759,7 @@ virDomainDefParse(const char *xmlStr,
|
|||||||
|
|
||||||
if ((xml = virXMLParse(filename, xmlStr, _("(domain_definition)")))) {
|
if ((xml = virXMLParse(filename, xmlStr, _("(domain_definition)")))) {
|
||||||
def = virDomainDefParseNode(xml, xmlDocGetRootElement(xml), caps,
|
def = virDomainDefParseNode(xml, xmlDocGetRootElement(xml), caps,
|
||||||
xmlopt, flags);
|
xmlopt, NULL, flags);
|
||||||
xmlFreeDoc(xml);
|
xmlFreeDoc(xml);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17790,6 +17791,7 @@ virDomainDefParseNode(xmlDocPtr xml,
|
|||||||
xmlNodePtr root,
|
xmlNodePtr root,
|
||||||
virCapsPtr caps,
|
virCapsPtr caps,
|
||||||
virDomainXMLOptionPtr xmlopt,
|
virDomainXMLOptionPtr xmlopt,
|
||||||
|
void *parseOpaque,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
xmlXPathContextPtr ctxt = NULL;
|
xmlXPathContextPtr ctxt = NULL;
|
||||||
@ -17810,7 +17812,7 @@ virDomainDefParseNode(xmlDocPtr xml,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ctxt->node = root;
|
ctxt->node = root;
|
||||||
def = virDomainDefParseXML(xml, root, ctxt, caps, xmlopt, flags);
|
def = virDomainDefParseXML(xml, root, ctxt, caps, xmlopt, parseOpaque, flags);
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
xmlXPathFreeContext(ctxt);
|
xmlXPathFreeContext(ctxt);
|
||||||
|
@ -2684,6 +2684,7 @@ virDomainDefPtr virDomainDefParseNode(xmlDocPtr doc,
|
|||||||
xmlNodePtr root,
|
xmlNodePtr root,
|
||||||
virCapsPtr caps,
|
virCapsPtr caps,
|
||||||
virDomainXMLOptionPtr xmlopt,
|
virDomainXMLOptionPtr xmlopt,
|
||||||
|
void *parseOpaque,
|
||||||
unsigned int flags);
|
unsigned int flags);
|
||||||
virDomainObjPtr virDomainObjParseNode(xmlDocPtr xml,
|
virDomainObjPtr virDomainObjParseNode(xmlDocPtr xml,
|
||||||
xmlNodePtr root,
|
xmlNodePtr root,
|
||||||
|
@ -282,7 +282,7 @@ virDomainSnapshotDefParse(xmlXPathContextPtr ctxt,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
def->dom = virDomainDefParseNode(ctxt->node->doc, domainNode,
|
def->dom = virDomainDefParseNode(ctxt->node->doc, domainNode,
|
||||||
caps, xmlopt, domainflags);
|
caps, xmlopt, NULL, domainflags);
|
||||||
if (!def->dom)
|
if (!def->dom)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1311,7 +1311,7 @@ qemuMigrationCookieXMLParse(qemuMigrationCookiePtr mig,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
mig->persistent = virDomainDefParseNode(doc, nodes[0],
|
mig->persistent = virDomainDefParseNode(doc, nodes[0],
|
||||||
caps, driver->xmlopt,
|
caps, driver->xmlopt, NULL,
|
||||||
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
VIR_DOMAIN_DEF_PARSE_INACTIVE |
|
||||||
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE |
|
VIR_DOMAIN_DEF_PARSE_ABI_UPDATE |
|
||||||
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
|
VIR_DOMAIN_DEF_PARSE_SKIP_VALIDATE);
|
||||||
|
@ -875,7 +875,7 @@ testParseDomains(testDriverPtr privconn,
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
def = virDomainDefParseNode(ctxt->doc, node,
|
def = virDomainDefParseNode(ctxt->doc, node,
|
||||||
privconn->caps, privconn->xmlopt,
|
privconn->caps, privconn->xmlopt, NULL,
|
||||||
VIR_DOMAIN_DEF_PARSE_INACTIVE);
|
VIR_DOMAIN_DEF_PARSE_INACTIVE);
|
||||||
if (!def)
|
if (!def)
|
||||||
goto error;
|
goto error;
|
||||||
|
Loading…
Reference in New Issue
Block a user