]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: Fix return value of qemuDomainGetBlockJobInfo
authorMichal Privoznik <mprivozn@redhat.com>
Mon, 4 Jan 2016 14:49:56 +0000 (15:49 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 5 Jan 2016 07:59:44 +0000 (08:59 +0100)
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 <mprivozn@redhat.com>
src/qemu/qemu_driver.c

index 304165c03e75427ffcab2dbf7308f532c98c3bab..1161aa0858a8c5ca112543cd2573cb7caa23f9b8 100644 (file)
@@ -16546,6 +16546,7 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom,
         virReportError(VIR_ERR_OVERFLOW,
                        _("bandwidth %llu cannot be represented in result"),
                        rawInfo.bandwidth);
+        ret = -1;
         goto endjob;
     }