qemu-devel
[Top][All Lists]
Advanced

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

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


From: Cindy Lu
Subject: [PATCH] vhost: Not return fail while the device does not support send_iotlb_msg
Date: Wed, 30 Nov 2022 16:11:20 +0800

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.

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]