[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] virtio: Add corresponding memory_listener_unregister to unre
From: |
Peter Xu |
Subject: |
Re: [PATCH] virtio: Add corresponding memory_listener_unregister to unrealize |
Date: |
Fri, 22 Jan 2021 15:17:20 -0500 |
On Fri, Jan 22, 2021 at 09:08:51PM +0100, Eugenio Pérez wrote:
> 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
>
Reviewed-by: Peter Xu <peterx@redhat.com>
CC stable, assuming that's what we need too.
Thanks,
--
Peter Xu
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [PATCH] virtio: Add corresponding memory_listener_unregister to unrealize,
Peter Xu <=