From: Peter Krempa Date: Wed, 20 Mar 2019 16:16:21 +0000 (+0100) Subject: qemu: Use virDomainStorageSourceParseBase in qemuDomainObjPrivateXMLParseJobNBDSource X-Git-Tag: v5.3.0-rc1~313 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79e3b15ce6873f88fe5c33c32edf33abb022ef86;p=thirdparty%2Flibvirt.git qemu: Use virDomainStorageSourceParseBase in qemuDomainObjPrivateXMLParseJobNBDSource Signed-off-by: Peter Krempa Reviewed-by: Ján Tomko --- diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 8e1918b755..a528cf51f0 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2724,9 +2724,6 @@ qemuDomainObjPrivateXMLParseJobNBDSource(xmlNodePtr node, if (!(ctxt->node = virXPathNode("./migrationSource", ctxt))) return 0; - if (!(migrSource = virStorageSourceNew())) - return -1; - if (!(type = virXMLPropString(ctxt->node, "type"))) { virReportError(VIR_ERR_XML_ERROR, "%s", _("missing storage source type")); @@ -2739,17 +2736,8 @@ qemuDomainObjPrivateXMLParseJobNBDSource(xmlNodePtr node, return -1; } - if ((migrSource->type = virStorageTypeFromString(type)) <= 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown storage source type '%s'"), type); - return -1; - } - - if ((migrSource->format = virStorageFileFormatTypeFromString(format)) <= 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("unknown storage source format '%s'"), format); + if (!(migrSource = virDomainStorageSourceParseBase(type, format, NULL))) return -1; - } /* newer libvirt uses the subelement instead of formatting the * source directly into */