From 2713ad857506ce338472e19706fbbab4ee4ba662 Mon Sep 17 00:00:00 2001 From: Adttil <2429917001@qq.com> Date: Mon, 8 Jul 2024 14:45:18 +0800 Subject: [PATCH] vdpa: Fix bug where vdpa appliance migration does not resume after rollback using vdpa->started to judge device started instead of vdev->vhost_started Signed-off-by: Adttil <2429917001@qq.com> --- hw/virtio/vdpa-dev-mig.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio/vdpa-dev-mig.c b/hw/virtio/vdpa-dev-mig.c index 23238c9f19..c080f9d89b 100644 --- a/hw/virtio/vdpa-dev-mig.c +++ b/hw/virtio/vdpa-dev-mig.c @@ -137,7 +137,7 @@ static int vhost_vdpa_device_suspend(VhostVdpaDevice *vdpa) { VirtIODevice *vdev = VIRTIO_DEVICE(vdpa); - if (!vdev->vhost_started || vdpa->suspended) { + if (!vdpa->started || vdpa->suspended) { return 0; } @@ -152,7 +152,7 @@ static int vhost_vdpa_device_resume(VhostVdpaDevice *vdpa) MigrationIncomingState *mis = migration_incoming_get_current(); int ret; - if (!vdev->vhost_started || + if (!vdpa->started || (!vdpa->suspended && mis->state != RUN_STATE_RESTORE_VM)) { return 0; } -- 2.41.0.windows.1