qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] vhost: Not return fail while the device does not support sen


From: Jason Wang
Subject: Re: [PATCH] vhost: Not return fail while the device does not support send_iotlb_msg
Date: Thu, 1 Dec 2022 16:49:35 +0800

On Wed, Nov 30, 2022 at 4:11 PM Cindy Lu <lulu@redhat.com> wrote:
>
> Some device does not support vhost_send_device_iotlb_msg()
> such as vDPA device, which is as expected. So we should not
> return fail here.

Please explain in which case you may hit the -ENODEV and what's the
side effect of this.

Thanks

>
> Signed-off-by: Cindy Lu <lulu@redhat.com>
> ---
>  hw/virtio/vhost-backend.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/virtio/vhost-backend.c b/hw/virtio/vhost-backend.c
> index 8e581575c9..9321ed9031 100644
> --- a/hw/virtio/vhost-backend.c
> +++ b/hw/virtio/vhost-backend.c
> @@ -360,7 +360,7 @@ int vhost_backend_update_device_iotlb(struct vhost_dev 
> *dev,
>      if (dev->vhost_ops && dev->vhost_ops->vhost_send_device_iotlb_msg)
>          return dev->vhost_ops->vhost_send_device_iotlb_msg(dev, &imsg);
>
> -    return -ENODEV;
> +    return 0;
>  }
>
>  int vhost_backend_invalidate_device_iotlb(struct vhost_dev *dev,
> @@ -375,7 +375,7 @@ int vhost_backend_invalidate_device_iotlb(struct 
> vhost_dev *dev,
>      if (dev->vhost_ops && dev->vhost_ops->vhost_send_device_iotlb_msg)
>          return dev->vhost_ops->vhost_send_device_iotlb_msg(dev, &imsg);
>
> -    return -ENODEV;
> +    return 0;
>  }
>
>  int vhost_backend_handle_iotlb_msg(struct vhost_dev *dev,
> --
> 2.34.3
>




reply via email to

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