mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15:17 +00:00
qemu: blockcopy: Add check for bandwidth
QEMU code does not work well with too big numbers on the JSON monitor so our monitor code supports sending only numbers up to LLONG_MAX. Avoid a weird error message by limiting the size of the 'bandwidth' parameter for block copy. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1532542 Signed-off-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
ca9aac53d3
commit
8f5133f99e
@ -17182,6 +17182,14 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (bandwidth > LLONG_MAX) {
|
||||
virReportError(VIR_ERR_INVALID_ARG,
|
||||
_("bandwidth must be less than "
|
||||
"'%llu' bytes/s (%llu MiB/s)"),
|
||||
LLONG_MAX, LLONG_MAX >> 20);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
|
||||
goto cleanup;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user