qemu: Parse NBD storage source private data by virDomainStorageSourceParse

Drop the local call in favor of passing in xmlopt.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2019-03-20 17:18:23 +01:00
parent 79e3b15ce6
commit 670053326b

View File

@ -2710,7 +2710,8 @@ qemuDomainObjPrivateXMLParsePR(xmlXPathContextPtr ctxt,
static int static int
qemuDomainObjPrivateXMLParseJobNBDSource(xmlNodePtr node, qemuDomainObjPrivateXMLParseJobNBDSource(xmlNodePtr node,
xmlXPathContextPtr ctxt, xmlXPathContextPtr ctxt,
virDomainDiskDefPtr disk) virDomainDiskDefPtr disk,
virDomainXMLOptionPtr xmlopt)
{ {
VIR_XPATH_NODE_AUTORESTORE(ctxt); VIR_XPATH_NODE_AUTORESTORE(ctxt);
qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk); qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
@ -2745,11 +2746,7 @@ qemuDomainObjPrivateXMLParseJobNBDSource(xmlNodePtr node,
ctxt->node = sourceNode; ctxt->node = sourceNode;
if (virDomainStorageSourceParse(ctxt->node, ctxt, migrSource, if (virDomainStorageSourceParse(ctxt->node, ctxt, migrSource,
VIR_DOMAIN_DEF_PARSE_STATUS, NULL) < 0) VIR_DOMAIN_DEF_PARSE_STATUS, xmlopt) < 0)
return -1;
if ((ctxt->node = virXPathNode("./privateData", ctxt)) &&
qemuStorageSourcePrivateDataParse(ctxt, migrSource) < 0)
return -1; return -1;
VIR_STEAL_PTR(diskPriv->migrSource, migrSource); VIR_STEAL_PTR(diskPriv->migrSource, migrSource);
@ -2785,7 +2782,8 @@ qemuDomainObjPrivateXMLParseJobNBD(virDomainObjPtr vm,
QEMU_DOMAIN_DISK_PRIVATE(disk)->migrating = true; QEMU_DOMAIN_DISK_PRIVATE(disk)->migrating = true;
if (qemuDomainObjPrivateXMLParseJobNBDSource(nodes[i], ctxt, if (qemuDomainObjPrivateXMLParseJobNBDSource(nodes[i], ctxt,
disk) < 0) disk,
priv->driver->xmlopt) < 0)
goto cleanup; goto cleanup;
} }