代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/qemu 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 302401ee7eb437712b69caff44ce684c88573dc6 Mon Sep 17 00:00:00 2001
From: Chuan Zheng <zhengchuan@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>
---
hw/virtio/vhost.c | 9 +++++++--
migration/migration.c | 2 +-
migration/migration.h | 1 +
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c
index 2c9ac79468..a8adc149ad 100644
--- a/hw/virtio/vhost.c
+++ b/hw/virtio/vhost.c
@@ -26,6 +26,7 @@
#include "hw/mem/memory-device.h"
#include "migration/blocker.h"
#include "migration/qemu-file-types.h"
+#include "migration/migration.h"
#include "sysemu/dma.h"
#include "trace.h"
@@ -1047,20 +1048,24 @@ check_dev_state:
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);
}
}
diff --git a/migration/migration.c b/migration/migration.c
index 3ce04b2aaf..71a03b3248 100644
--- a/migration/migration.c
+++ b/migration/migration.c
@@ -1377,7 +1377,7 @@ static void migrate_error_free(MigrationState *s)
}
}
-static void migrate_fd_error(MigrationState *s, const Error *error)
+void migrate_fd_error(MigrationState *s, const Error *error)
{
trace_migrate_fd_error(error_get_pretty(error));
assert(s->to_dst_file == NULL);
diff --git a/migration/migration.h b/migration/migration.h
index cf2c9c88e0..6aafa04314 100644
--- a/migration/migration.h
+++ b/migration/migration.h
@@ -482,6 +482,7 @@ bool migration_has_all_channels(void);
uint64_t migrate_max_downtime(void);
+void migrate_fd_error(MigrationState *s, const Error *error);
void migrate_set_error(MigrationState *s, const Error *error);
bool migrate_has_error(MigrationState *s);
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。