From: Pavel Hrdina Date: Thu, 27 May 2021 13:32:17 +0000 (+0200) Subject: virDomainDiskDefParseSource: parse source bits from driver element X-Git-Tag: v7.5.0-rc1~225 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d225ea284368f2774f737711c2fecc135dfcf05;p=thirdparty%2Flibvirt.git virDomainDiskDefParseSource: parse source bits from driver element Before the mentioned commit we always parsed the whole disk definition for qemuDomainBlockCopy API but we only used the @src part. Based on that assumption the code was changed to parse only the disk element. Unfortunately that is not correct as we need to parse some parts of element as well. Fixes: 0202467c4ba8663db2304b140af609f93a9b3091 Signed-off-by: Pavel Hrdina Reviewed-by: Peter Krempa --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index f7920bce2c..f424ed731f 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15141,6 +15141,7 @@ virDomainDiskDefParseSource(const char *xmlStr, g_autoptr(xmlDoc) xml = NULL; g_autoptr(xmlXPathContext) ctxt = NULL; g_autoptr(virStorageSource) src = NULL; + xmlNodePtr driverNode; if (!(xml = virXMLParseStringCtxtRoot(xmlStr, _("(disk_definition)"), "disk", &ctxt))) return NULL; @@ -15148,6 +15149,11 @@ virDomainDiskDefParseSource(const char *xmlStr, if (!(src = virDomainDiskDefParseSourceXML(xmlopt, ctxt->node, ctxt, flags))) return NULL; + if ((driverNode = virXPathNode("./driver", ctxt))) { + if (virDomainDiskDefDriverSourceParseXML(src, driverNode, ctxt) < 0) + return NULL; + } + if (virStorageSourceIsEmpty(src)) { virReportError(VIR_ERR_NO_SOURCE, NULL); return NULL;