This patch adds more accurate error string when fail to open vhost
vDPA device.

Signed-off-by: Jason Wang <jasow...@redhat.com>
---
 net/vhost-vdpa.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/vhost-vdpa.c b/net/vhost-vdpa.c
index f5cc4e8326..9a6f0b63d3 100644
--- a/net/vhost-vdpa.c
+++ b/net/vhost-vdpa.c
@@ -219,6 +219,7 @@ int net_init_vhost_vdpa(const Netdev *netdev, const char 
*name,
     s = DO_UPCAST(VhostVDPAState, nc, nc);
     vdpa_device_fd = qemu_open(opts->vhostdev, O_RDWR);
     if (vdpa_device_fd == -1) {
+        error_setg(errp, "Fail to open vhost-vdpa device %s", opts->vhostdev);
         return -errno;
     }
     s->vhost_vdpa.device_fd = vdpa_device_fd;
-- 
2.20.1


Reply via email to