From 257ffabb9c06b476a3a42bf679db6fbc61c19459 Mon Sep 17 00:00:00 2001 From: Adttil <2429917001@qq.com> Date: Fri, 25 Apr 2025 09:41:59 +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->start 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 d29075aa04..bec6e63fc7 100644 --- a/hw/virtio/vhost.c +++ b/hw/virtio/vhost.c @@ -252,7 +252,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; } @@ -2624,7 +2624,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; -- Gitee