提交 65de5f6f 编写于 作者: J Jiri Denemark

qemu: Avoid deprecated migrate_set_downtime QMP command

The same functionality can be achieved using migrate-set-parameters QMP
command with downtime-limit parameter.

https://bugzilla.redhat.com/show_bug.cgi?id=1829543Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
上级 92b8dbc6
......@@ -13857,7 +13857,9 @@ qemuDomainMigrateSetMaxDowntime(virDomainPtr dom,
virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
qemuDomainObjPrivatePtr priv;
g_autoptr(qemuMigrationParams) migParams = NULL;
int ret = -1;
int rc;
virCheckFlags(0, -1);
......@@ -13876,10 +13878,27 @@ qemuDomainMigrateSetMaxDowntime(virDomainPtr dom,
priv = vm->privateData;
VIR_DEBUG("Setting migration downtime to %llums", downtime);
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorSetMigrationDowntime(priv->mon, downtime);
if (qemuDomainObjExitMonitor(driver, vm) < 0)
ret = -1;
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_PARAM_DOWNTIME)) {
if (!(migParams = qemuMigrationParamsNew()))
goto endjob;
if (qemuMigrationParamsSetULL(migParams,
QEMU_MIGRATION_PARAM_DOWNTIME_LIMIT,
downtime) < 0)
goto endjob;
if (qemuMigrationParamsApply(driver, vm, QEMU_ASYNC_JOB_NONE,
migParams) < 0)
goto endjob;
} else {
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorSetMigrationDowntime(priv->mon, downtime);
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
goto endjob;
}
ret = 0;
endjob:
qemuDomainObjEndJob(driver, vm);
......
......@@ -3221,7 +3221,7 @@ mymain(void)
DO_TEST_GEN(qemuMonitorJSONSaveVirtualMemory);
DO_TEST_GEN(qemuMonitorJSONSavePhysicalMemory);
DO_TEST_GEN_DEPRECATED(qemuMonitorJSONSetMigrationSpeed, true);
DO_TEST_GEN_DEPRECATED(qemuMonitorJSONSetMigrationDowntime, false);
DO_TEST_GEN_DEPRECATED(qemuMonitorJSONSetMigrationDowntime, true);
DO_TEST_GEN(qemuMonitorJSONMigrate);
DO_TEST_GEN(qemuMonitorJSONDump);
DO_TEST_GEN(qemuMonitorJSONGraphicsRelocate);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册