From a6945f2287aa7f048b263d7187364cbf1dd5d94d Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Wed, 9 Jun 2021 08:46:52 -0700 Subject: 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 Message-Id: <20210609154658.350308-2-kwolf@redhat.com> Reviewed-by: Stefano Garzarella Reviewed-by: Raphael Norwitz Signed-off-by: Kevin Wolf --- hw/virtio/vhost-user-vsock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'hw/virtio/vhost-user-vsock.c') diff --git a/hw/virtio/vhost-user-vsock.c b/hw/virtio/vhost-user-vsock.c index a6f08c26b9..b6a4a25ea1 100644 --- a/hw/virtio/vhost-user-vsock.c +++ b/hw/virtio/vhost-user-vsock.c @@ -108,9 +108,8 @@ static void vuv_device_realize(DeviceState *dev, Error **errp) vhost_dev_set_config_notifier(&vvc->vhost_dev, &vsock_ops); ret = vhost_dev_init(&vvc->vhost_dev, &vsock->vhost_user, - VHOST_BACKEND_TYPE_USER, 0); + VHOST_BACKEND_TYPE_USER, 0, errp); if (ret < 0) { - error_setg_errno(errp, -ret, "vhost_dev_init failed"); goto err_virtio; } -- cgit v1.2.3