diff mbox series

[12/40] vdpa: check map_thread_enabled before join maps thread

Message ID 1701970793-6865-13-git-send-email-si-wei.liu@oracle.com (mailing list archive)
State New, archived
Headers show
Series vdpa-net: improve migration downtime through descriptor ASID and persistent IOTLB | expand

Commit Message

Si-Wei Liu Dec. 7, 2023, 5:39 p.m. UTC
The next patches will also register memory listener on
demand, hence the need to differentiate the map_thread
case from the rest.

Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>
---
 hw/virtio/vhost-vdpa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
index 2b1cc14..4f026db 100644
--- a/hw/virtio/vhost-vdpa.c
+++ b/hw/virtio/vhost-vdpa.c
@@ -1450,7 +1450,7 @@  static int vhost_vdpa_dev_start(struct vhost_dev *dev, bool started)
         if (!v->shared->listener_registered) {
             memory_listener_register(&v->shared->listener, dev->vdev->dma_as);
             v->shared->listener_registered = true;
-        } else {
+        } else if (v->shared->map_thread_enabled) {
             ok = vhost_vdpa_join_maps_thread(v->shared);
             if (unlikely(!ok)) {
                 goto out_stop;