提交 8f5133f9 编写于 作者: P Peter Krempa

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=1532542Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
上级 ca9aac53
...@@ -17182,6 +17182,14 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm, ...@@ -17182,6 +17182,14 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm,
goto cleanup; 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) if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup; goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册