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