aboutsummaryrefslogtreecommitdiff
path: root/hw/virtio/vhost-vsock.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2021-06-09 08:46:52 -0700
committerKevin Wolf <kwolf@redhat.com>2021-06-30 13:15:44 +0200
commita6945f2287aa7f048b263d7187364cbf1dd5d94d (patch)
tree999b68cfc5e64af247afbc10b6fb99983583e76a /hw/virtio/vhost-vsock.c
parentbf783261f0aee6e81af3916bff7606d71ccdc153 (diff)
vhost: Add Error parameter to vhost_dev_init()
This allows callers to return better error messages instead of making one up while the real error ends up on stderr. Most callers can immediately make use of this because they already have an Error parameter themselves. The others just keep printing the error with error_report_err(). Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20210609154658.350308-2-kwolf@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/virtio/vhost-vsock.c')
-rw-r--r--hw/virtio/vhost-vsock.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/virtio/vhost-vsock.c b/hw/virtio/vhost-vsock.c
index 8ddfb9abfe..777cafe70d 100644
--- a/hw/virtio/vhost-vsock.c
+++ b/hw/virtio/vhost-vsock.c
@@ -170,9 +170,8 @@ static void vhost_vsock_device_realize(DeviceState *dev, Error **errp)
vhost_vsock_common_realize(vdev, "vhost-vsock");
ret = vhost_dev_init(&vvc->vhost_dev, (void *)(uintptr_t)vhostfd,
- VHOST_BACKEND_TYPE_KERNEL, 0);
+ VHOST_BACKEND_TYPE_KERNEL, 0, errp);
if (ret < 0) {
- error_setg_errno(errp, -ret, "vhost-vsock: vhost_dev_init failed");
goto err_virtio;
}