提交 dff3ad00 编写于 作者: J Jiri Denemark

qemu: Avoid overflow when setting migration speed on inactive domains

Commit c4206d7c fixed the overflow for running domains. However, we need
a similar check when setting migration speed on inactive domains.

At first look, it may seem the check in c4206d7c is now redundant but
qemuDomainMigrateSetMaxSpeed is not the only caller of
qemuMonitorSetMigrationSpeed so we need to check the bandwidth in both
places.

https://bugzilla.redhat.com/show_bug.cgi?id=1083483Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 dd477238
...@@ -11927,6 +11927,13 @@ qemuDomainMigrateSetMaxSpeed(virDomainPtr dom, ...@@ -11927,6 +11927,13 @@ qemuDomainMigrateSetMaxSpeed(virDomainPtr dom,
if (virDomainMigrateSetMaxSpeedEnsureACL(dom->conn, vm->def) < 0) if (virDomainMigrateSetMaxSpeedEnsureACL(dom->conn, vm->def) < 0)
goto cleanup; goto cleanup;
if (bandwidth > QEMU_DOMAIN_MIG_BANDWIDTH_MAX) {
virReportError(VIR_ERR_OVERFLOW,
_("bandwidth must be less than %llu"),
QEMU_DOMAIN_MIG_BANDWIDTH_MAX + 1ULL);
goto cleanup;
}
if (virDomainObjIsActive(vm)) { if (virDomainObjIsActive(vm)) {
if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MIGRATION_OP) < 0) if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MIGRATION_OP) < 0)
goto cleanup; goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册