[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] virtio: Add corresponding memory_listener_unregister to unrealiz

From: Eugenio Pérez
Subject: [PATCH] virtio: Add corresponding memory_listener_unregister to unrealize
Date: Fri, 22 Jan 2021 21:08:51 +0100

Cannot destroy address spaces of IOMMU-aware virtio devices without it,
since they can contain memory listeners.

Fixes: c611c76417f ("virtio: add MemoryListener to cache ring translations")
Buglink: https://bugs.launchpad.net/qemu/+bug/1912846
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
 hw/virtio/virtio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index b308026596..67efd2c301 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -3680,6 +3680,7 @@ static void virtio_device_unrealize(DeviceState *dev)
     VirtIODevice *vdev = VIRTIO_DEVICE(dev);
     VirtioDeviceClass *vdc = VIRTIO_DEVICE_GET_CLASS(dev);
+    memory_listener_unregister(&vdev->listener);
     if (vdc->unrealize != NULL) {

reply via email to

[Prev in Thread] Current Thread [Next in Thread]