mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 15:52:55 +00:00
qemu: Use virDomainStorageSourceParseBase in qemuDomainObjPrivateXMLParseJobNBDSource
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
ef5ed42655
commit
79e3b15ce6
@ -2724,9 +2724,6 @@ qemuDomainObjPrivateXMLParseJobNBDSource(xmlNodePtr node,
|
|||||||
if (!(ctxt->node = virXPathNode("./migrationSource", ctxt)))
|
if (!(ctxt->node = virXPathNode("./migrationSource", ctxt)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (!(migrSource = virStorageSourceNew()))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (!(type = virXMLPropString(ctxt->node, "type"))) {
|
if (!(type = virXMLPropString(ctxt->node, "type"))) {
|
||||||
virReportError(VIR_ERR_XML_ERROR, "%s",
|
virReportError(VIR_ERR_XML_ERROR, "%s",
|
||||||
_("missing storage source type"));
|
_("missing storage source type"));
|
||||||
@ -2739,17 +2736,8 @@ qemuDomainObjPrivateXMLParseJobNBDSource(xmlNodePtr node,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((migrSource->type = virStorageTypeFromString(type)) <= 0) {
|
if (!(migrSource = virDomainStorageSourceParseBase(type, format, NULL)))
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
|
||||||
_("unknown storage source type '%s'"), type);
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
|
||||||
|
|
||||||
if ((migrSource->format = virStorageFileFormatTypeFromString(format)) <= 0) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
|
||||||
_("unknown storage source format '%s'"), format);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* newer libvirt uses the <source> subelement instead of formatting the
|
/* newer libvirt uses the <source> subelement instead of formatting the
|
||||||
* source directly into <migrationSource> */
|
* source directly into <migrationSource> */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user