提交 2481fcea 编写于 作者: J Jiri Denemark

qemu: Avoid deprecated migrate-set-cache-size QMP command

The same functionality can be achieved using migrate-set-parameters QMP
command with xbzrle-cache-size parameter.

https://bugzilla.redhat.com/show_bug.cgi?id=1845012Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
Reviewed-by: NPeter Krempa <pkrempa@redhat.com>
上级 0b45addf
......@@ -14032,7 +14032,9 @@ qemuDomainMigrateSetCompressionCache(virDomainPtr dom,
virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
qemuDomainObjPrivatePtr priv;
g_autoptr(qemuMigrationParams) migParams = NULL;
int ret = -1;
int rc;
virCheckFlags(0, -1);
......@@ -14057,13 +14059,27 @@ qemuDomainMigrateSetCompressionCache(virDomainPtr dom,
goto endjob;
}
qemuDomainObjEnterMonitor(driver, vm);
VIR_DEBUG("Setting compression cache to %llu B", cacheSize);
ret = qemuMonitorSetMigrationCacheSize(priv->mon, cacheSize);
if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_PARAM_XBZRLE_CACHE_SIZE)) {
if (!(migParams = qemuMigrationParamsNew()))
goto endjob;
if (qemuDomainObjExitMonitor(driver, vm) < 0)
ret = -1;
if (qemuMigrationParamsSetULL(migParams,
QEMU_MIGRATION_PARAM_XBZRLE_CACHE_SIZE,
cacheSize) < 0)
goto endjob;
if (qemuMigrationParamsApply(driver, vm, QEMU_ASYNC_JOB_NONE,
migParams) < 0)
goto endjob;
} else {
qemuDomainObjEnterMonitor(driver, vm);
rc = qemuMonitorSetMigrationCacheSize(priv->mon, cacheSize);
if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
goto endjob;
}
ret = 0;
endjob:
qemuDomainObjEndJob(driver, vm);
......
......@@ -869,8 +869,7 @@ qemuMigrationParamsApply(virQEMUDriverPtr driver,
* qemuMonitorSetMigrationParams to ignore this parameter.
*/
if (migParams->params[xbzrle].set &&
(!priv->job.migParams ||
!priv->job.migParams->params[xbzrle].set)) {
!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_PARAM_XBZRLE_CACHE_SIZE)) {
if (qemuMonitorSetMigrationCacheSize(priv->mon,
migParams->params[xbzrle].value.ull) < 0)
goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册