From 7a8e59e39b342574852c18851f3926742f0adc0c Mon Sep 17 00:00:00 2001 From: Adttil <2429917001@qq.com> Date: Thu, 24 Apr 2025 09:47:45 +0800 Subject: [PATCH] vdpa:Fix dirty page bitmap synchronization not done after suspend for vdpa devices Change the flag for vdpa device to determine whether to perform log_sync from dev->started to dev->log, and do not release dev->log after vdpa device suspend, and release it uniformly by vhost_dev_stop. Signed-off-by: Adttil <2429917001@qq.com> --- hw/virtio/vhost.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/virtio/vhost.c b/hw/virtio/vhost.c index ed1506d3e0..91b0019469 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -288,7 +288,7 @@ static void vhost_log_sync(MemoryListener *listener, memory_listener); MigrationState *ms = migrate_get_current(); - if (!dev->log_enabled || !dev->started) { + if (!dev->log_enabled || !dev->log) { return; } @@ -2327,7 +2327,6 @@ int vhost_dev_suspend(struct vhost_dev *hdev, VirtIODevice *vdev, bool vrings) memory_listener_unregister(&hdev->iommu_listener); } vhost_stop_config_intr(hdev); - vhost_log_put(hdev, true); hdev->started = false; vdev->vhost_started = false; hdev->vdev = NULL; -- 2.41.0.windows.1