From: Peter Krempa Date: Wed, 5 Feb 2014 17:40:39 +0000 (+0100) Subject: qemu: blockjob: Print correct file name in error message X-Git-Tag: v1.2.2-rc1~169 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d2691cc4c0b8d64440b072c93f157f641c37a72;p=thirdparty%2Flibvirt.git qemu: blockjob: Print correct file name in error message When attempting a blockcommit from the top layer, the base argument passed is NULL. This will be dereferenced when attempting a commit with an empty image chain. Output the real volume path instead: virsh blockcommit --verbose --path vda --domain DOMNAME --wait error: invalid argument: top '/path/somefile' in chain for 'vda' has no backing file instead of: error: invalid argument: top '(null)' in chain for 'vda' has no backing file --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 38a48db35f..8998201abb 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -15180,7 +15180,7 @@ qemuDomainBlockCommit(virDomainPtr dom, const char *path, const char *base, if (!top_meta || !top_meta->backingStore) { virReportError(VIR_ERR_INVALID_ARG, _("top '%s' in chain for '%s' has no backing file"), - top, path); + top_canon, path); goto endjob; } if (!base && (flags & VIR_DOMAIN_BLOCK_COMMIT_SHALLOW)) {