mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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:
parent
ead30f4dd5
commit
783b254413
@ -16546,6 +16546,7 @@ qemuDomainGetBlockJobInfo(virDomainPtr dom,
|
|||||||
virReportError(VIR_ERR_OVERFLOW,
|
virReportError(VIR_ERR_OVERFLOW,
|
||||||
_("bandwidth %llu cannot be represented in result"),
|
_("bandwidth %llu cannot be represented in result"),
|
||||||
rawInfo.bandwidth);
|
rawInfo.bandwidth);
|
||||||
|
ret = -1;
|
||||||
goto endjob;
|
goto endjob;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user