qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 18/40] vdpa: unregister listener on last dev cleanup


From: Eugenio Perez Martin
Subject: Re: [PATCH 18/40] vdpa: unregister listener on last dev cleanup
Date: Mon, 11 Dec 2023 18:37:25 +0100

On Thu, Dec 7, 2023 at 7:50 PM Si-Wei Liu <si-wei.liu@oracle.com> wrote:
>
> So that the free of iova tree struct can be safely deferred to
> until the last vq referencing it goes away.
>

I think this patch message went out of sync too.

> Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com>
> ---
>  hw/virtio/vhost-vdpa.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/hw/virtio/vhost-vdpa.c b/hw/virtio/vhost-vdpa.c
> index 4f026db..ea2dfc8 100644
> --- a/hw/virtio/vhost-vdpa.c
> +++ b/hw/virtio/vhost-vdpa.c
> @@ -815,7 +815,10 @@ static int vhost_vdpa_cleanup(struct vhost_dev *dev)
>      }
>
>      vhost_vdpa_host_notifiers_uninit(dev, dev->nvqs);
> -    memory_listener_unregister(&v->shared->listener);
> +    if (vhost_vdpa_last_dev(dev) && v->shared->listener_registered) {
> +        memory_listener_unregister(&v->shared->listener);
> +        v->shared->listener_registered = false;
> +    }

I think this version is more correct, but it should not matter as the
device cleanup implies the device will not be used anymore, isn't it?
Or am I missing something?

>      vhost_vdpa_svq_cleanup(dev);
>
>      dev->opaque = NULL;
> --
> 1.8.3.1
>




reply via email to

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