加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
qemu-Avoid-deprecated-migrate_set_downtime-QMP-comma.patch 2.19 KB
一键复制 编辑 原始数据 按行查看 历史
yezengruan 提交于 2022-03-11 20:33 . update patch with openeuler !55
From df9385f88c666783c7ac53800f00e359a4177145 Mon Sep 17 00:00:00 2001
From: Jiri Denemark <jdenemar@redhat.com>
Date: Wed, 10 Jun 2020 16:13:15 +0200
Subject: [PATCH 3/8] 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=1829543
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
---
src/qemu/qemu_driver.c | 27 +++++++++++++++++++++++----
1 file changed, 23 insertions(+), 4 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 1521bc6b2b..3482dccc43 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -13892,7 +13892,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);
@@ -13911,10 +13913,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);
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化