1 Star 0 Fork 131

JianChunfu/src-qemu

forked from src-openEuler/qemu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
migration-Set-downtime_start-even-for-postcopy.patch 2.16 KB
一键复制 编辑 原始数据 按行查看 历史
Jiabo Feng 提交于 2023-12-22 09:29 +08:00 . QEMU update to version 6.2.0-87(master)
From 9708192479d7f6507392a338f8f43b3be4c8188d Mon Sep 17 00:00:00 2001
From: qihao <qihao_yewu@cmss.chinamobile.com>
Date: Mon, 18 Dec 2023 15:19:48 +0800
Subject: [PATCH] migration: Set downtime_start even for postcopy
cheery-pick from 62f5da7dd10a594fb30cebb5569dc738456f7131
Postcopy calculates its downtime separately. It always sets
MigrationState.downtime properly, but not MigrationState.downtime_start.
Make postcopy do the same as other modes on properly recording the
timestamp when the VM is going to be stopped. Drop the temporary variable
in postcopy_start() along the way.
Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
Message-ID: <20231030163346.765724-2-peterx@redhat.com>
Signed-off-by: qihao_yewu <qihao_yewu@cmss.chinamobile.com>
---
migration/migration.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/migration/migration.c b/migration/migration.c
index 6b5445853a..7ca5b58839 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -2989,7 +2989,6 @@ static int postcopy_start(MigrationState *ms)
int ret;
QIOChannelBuffer *bioc;
QEMUFile *fb;
- int64_t time_at_stop = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
int64_t bandwidth = migrate_max_postcopy_bandwidth();
bool restart_block = false;
int cur_state = MIGRATION_STATUS_ACTIVE;
@@ -3002,6 +3001,8 @@ static int postcopy_start(MigrationState *ms)
qemu_mutex_lock_iothread();
trace_postcopy_start_set_run();
+ ms->downtime_start = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
+
qemu_system_wakeup_request(QEMU_WAKEUP_REASON_OTHER, NULL);
global_state_store();
ret = vm_stop_force_state(RUN_STATE_FINISH_MIGRATE);
@@ -3112,7 +3113,7 @@ static int postcopy_start(MigrationState *ms)
ms->postcopy_after_devices = true;
notifier_list_notify(&migration_state_notifiers, ms);
- ms->downtime = qemu_clock_get_ms(QEMU_CLOCK_REALTIME) - time_at_stop;
+ ms->downtime = qemu_clock_get_ms(QEMU_CLOCK_REALTIME) - ms->downtime_start;
qemu_mutex_unlock_iothread();
--
2.27.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jianchunfu/src-qemu.git
git@gitee.com:jianchunfu/src-qemu.git
jianchunfu
src-qemu
src-qemu
master

搜索帮助