1 Star 0 Fork 131

Chuan/qemu

forked from src-openEuler/qemu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vhost-cancel-migration-when-vhost-user-restarted.patch 1.74 KB
一键复制 编辑 原始数据 按行查看 历史
hexiaowen 提交于 2019-09-30 23:15 +08:00 . Package init
From 750328e01afe4776eaddacde406063978dbf1291 Mon Sep 17 00:00:00 2001
From: Ying Fang <fangying1@huawei.com>
Date: Mon, 29 Jul 2019 16:22:12 +0800
Subject: [PATCH] vhost: cancel migration when vhost-user restarted during
migraiton
Qemu will abort when vhost-user process is restarted during migration
when vhost_log_global_start/stop is called. The reason is clear that
vhost_dev_set_log returns -1 because network connection is temporarily
lost. Let's cancel migraiton and report it to user in this abnormal
situation.
Signed-off-by: Ying Fang <fangying1@huawei.com>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
---
hw/virtio/vhost.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 7f61018f..f302c506 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -26,6 +26,7 @@
#include "hw/virtio/virtio-bus.h"
#include "hw/virtio/virtio-access.h"
#include "migration/blocker.h"
+#include "migration/migration.h"
#include "sysemu/dma.h"
#include "trace.h"
@@ -808,20 +809,24 @@ static int vhost_migration_log(MemoryListener *listener, int enable)
static void vhost_log_global_start(MemoryListener *listener)
{
int r;
+ Error *errp = NULL;
r = vhost_migration_log(listener, true);
if (r < 0) {
- abort();
+ error_setg(&errp, "Failed to start vhost migration log");
+ migrate_fd_error(migrate_get_current(), errp);
}
}
static void vhost_log_global_stop(MemoryListener *listener)
{
int r;
+ Error *errp = NULL;
r = vhost_migration_log(listener, false);
if (r < 0) {
- abort();
+ error_setg(&errp, "Failed to stop vhost migration log");
+ migrate_fd_error(migrate_get_current(), errp);
}
}
--
2.19.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Chuan-Zheng/qemu.git
git@gitee.com:Chuan-Zheng/qemu.git
Chuan-Zheng
qemu
qemu
master

搜索帮助