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 <l...@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