qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] virtio: Add corresponding memory_listener_unregister to unre


From: Jason Wang
Subject: Re: [PATCH] virtio: Add corresponding memory_listener_unregister to unrealize
Date: Mon, 25 Jan 2021 11:15:03 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0


On 2021/1/23 上午4:08, Eugenio Pérez wrote:
Cannot destroy address spaces of IOMMU-aware virtio devices without it,
since they can contain memory listeners.


It's better to explain why the one in finalize doesn't work here.

Thanks



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) {




reply via email to

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