代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/qemu 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 4688e12c57a34801010abf2a4cf528fcef3b9ec0 Mon Sep 17 00:00:00 2001
From: libai <libai12@huawei.com>
Date: Mon, 4 Dec 2023 15:59:56 +0800
Subject: [PATCH] vdpa: implement vdpa device migration
Integrate the live migration code, call the registered live
migration function, and open the vdpa live migration prototype
Signed-off-by: libai <libai12@huawei.com>
---
hw/virtio/vdpa-dev.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/vdpa-dev.c b/hw/virtio/vdpa-dev.c
index f22d5d5bc0..6af78a4229 100644
--- a/hw/virtio/vdpa-dev.c
+++ b/hw/virtio/vdpa-dev.c
@@ -28,6 +28,8 @@
#include "hw/virtio/vdpa-dev.h"
#include "sysemu/sysemu.h"
#include "sysemu/runstate.h"
+#include "hw/virtio/vdpa-dev-mig.h"
+#include "migration/migration.h"
static void
vhost_vdpa_device_dummy_handle_output(VirtIODevice *vdev, VirtQueue *vq)
@@ -154,6 +156,8 @@ static void vhost_vdpa_device_realize(DeviceState *dev, Error **errp)
vhost_vdpa_device_dummy_handle_output);
}
+ vdpa_migration_register(v);
+
return;
free_config:
@@ -173,6 +177,7 @@ static void vhost_vdpa_device_unrealize(DeviceState *dev)
VhostVdpaDevice *s = VHOST_VDPA_DEVICE(vdev);
int i;
+ vdpa_migration_unregister(s);
virtio_set_status(vdev, 0);
for (i = 0; i < s->num_queues; i++) {
@@ -308,6 +313,7 @@ static void vhost_vdpa_device_stop(VirtIODevice *vdev)
static void vhost_vdpa_device_set_status(VirtIODevice *vdev, uint8_t status)
{
VhostVdpaDevice *s = VHOST_VDPA_DEVICE(vdev);
+ MigrationState *ms = migrate_get_current();
bool should_start = virtio_device_started(vdev, status);
Error *local_err = NULL;
int ret;
@@ -320,6 +326,11 @@ static void vhost_vdpa_device_set_status(VirtIODevice *vdev, uint8_t status)
return;
}
+ if (ms->state == RUN_STATE_PAUSED ||
+ ms->state == RUN_STATE_RESTORE_VM) {
+ return;
+ }
+
if (should_start) {
ret = vhost_vdpa_device_start(vdev, &local_err);
if (ret < 0) {
@@ -338,7 +349,7 @@ static Property vhost_vdpa_device_properties[] = {
static const VMStateDescription vmstate_vhost_vdpa_device = {
.name = "vhost-vdpa-device",
- .unmigratable = 1,
+ .unmigratable = 0,
.minimum_version_id = 1,
.version_id = 1,
.fields = (VMStateField[]) {
--
2.27.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。