qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] virtio: Add corresponding memory_listener_unregister to unrealize
@ 2021-01-22 20:08 Eugenio Pérez
  2021-01-22 20:17 ` Peter Xu
  2021-01-25  3:15 ` Jason Wang
  0 siblings, 2 replies; 6+ messages in thread
From: Eugenio Pérez @ 2021-01-22 20:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jason Wang, Peter Xu, Michael S. Tsirkin

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);
     virtio_bus_device_unplugged(vdev);
 
     if (vdc->unrealize != NULL) {
-- 
2.27.0



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-25 19:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-22 20:08 [PATCH] virtio: Add corresponding memory_listener_unregister to unrealize Eugenio Pérez
2021-01-22 20:17 ` Peter Xu
2021-01-25  3:15 ` Jason Wang
2021-01-25 16:55   ` Eugenio Perez Martin
2021-01-25 17:18     ` Peter Xu
2021-01-25 19:22       ` Eugenio Perez Martin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).