1 Star 0 Fork 71

梓瑶/libvirt

forked from src-openEuler/libvirt 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
qemu-Avoid-deprecated-query-migrate-cache-size-QMP-c.patch 2.09 KB
一键复制 编辑 原始数据 按行查看 历史
yezengruan 提交于 2022-03-11 20:33 . update patch with openeuler !55
From c458102192d82a3a8a5f045cd9df34c29b287ab8 Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Wed, 10 Jun 2020 16:13:15 +0200
Subject: [PATCH 4/8] qemu: Avoid deprecated query-migrate-cache-size QMP
command
The same functionality can be achieved using query-migrate-parameters
QMP command and checking the xbzrle-cache-size parameter.
https://bugzilla.redhat.com/show_bug.cgi?id=1829544
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
---
src/qemu/qemu_driver.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 3482dccc43..1ad33197e0 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14006,7 +14006,9 @@ qemuDomainMigrateGetCompressionCache(virDomainPtr dom,
virQEMUDriverPtr driver = dom->conn->privateData;
virDomainObjPtr vm;
qemuDomainObjPrivatePtr priv;
+ g_autoptr(qemuMigrationParams) migParams = NULL;
int ret = -1;
+ int rc;
virCheckFlags(0, -1);
@@ -14031,12 +14033,23 @@ qemuDomainMigrateGetCompressionCache(virDomainPtr dom,
goto endjob;
}
- qemuDomainObjEnterMonitor(driver, vm);
+ if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_PARAM_XBZRLE_CACHE_SIZE)) {
+ if (qemuMigrationParamsFetch(driver, vm, QEMU_ASYNC_JOB_NONE,
+ &migParams) < 0)
+ goto endjob;
- ret = qemuMonitorGetMigrationCacheSize(priv->mon, cacheSize);
+ if (qemuMigrationParamsGetULL(migParams,
+ QEMU_MIGRATION_PARAM_XBZRLE_CACHE_SIZE,
+ cacheSize) < 0)
+ goto endjob;
+ } else {
+ qemuDomainObjEnterMonitor(driver, vm);
+ rc = qemuMonitorGetMigrationCacheSize(priv->mon, cacheSize);
+ if (qemuDomainObjExitMonitor(driver, vm) < 0 || rc < 0)
+ goto endjob;
+ }
- if (qemuDomainObjExitMonitor(driver, vm) < 0)
- ret = -1;
+ ret = 0;
endjob:
qemuDomainObjEndJob(driver, vm);
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ziyao233/libvirt.git
git@gitee.com:ziyao233/libvirt.git
ziyao233
libvirt
libvirt
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385