qemu: Fix return value of qemuDomainGetBlockJobInfo

While reviewing 1b43885d17 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>
This commit is contained in:
Michal Privoznik 2016-01-04 15:49:56 +01:00
parent ead30f4dd5
commit 783b254413

View 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;
}