From: Michal Privoznik Date: Mon, 4 Jan 2016 14:49:56 +0000 (+0100) Subject: qemu: Fix return value of qemuDomainGetBlockJobInfo X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=783b254413fee8d33467a0abd4dff609a1daef7b;p=libvirt.git qemu: Fix return value of qemuDomainGetBlockJobInfo While reviewing 1b43885d1784640 I've noticed a virReportError() followed by a goto endjob; without setting the correct return value. Problem is, if block job is so fast that it's bandwidth does not fit into ulong, an error is reported. However, by that time @ret is already set to 1 which means success. Since the scenario can be hardly considered successful, we should return a value meaning error. Signed-off-by: Michal Privoznik --- diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 304165c03e..1161aa0858 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -16546,6 +16546,7 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom, virReportError(VIR_ERR_OVERFLOW, _("bandwidth %llu cannot be represented in result"), rawInfo.bandwidth); + ret = -1; goto endjob; }