mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
vhost: Distinguish errors in vhost_backend_init()
Instead of just returning 0/-1 and letting the caller make up a meaningless error message, add an Error parameter to allow reporting the real error and switch to 0/-errno so that different kind of errors can be distinguished in the caller. Specifically, in vhost-user, EPROTO is used for all errors that relate to the connection itself, whereas other error codes are used for errors relating to the content of the connection. This will allow us later to automatically reconnect when the connection goes away, without ending up in an endless loop if it's a permanent error in the configuration. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20210609154658.350308-3-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>
This commit is contained in:
parent
a6945f2287
commit
28770ff935
5 changed files with 32 additions and 29 deletions
|
@ -37,7 +37,8 @@ struct vhost_scsi_target;
|
|||
struct vhost_iotlb_msg;
|
||||
struct vhost_virtqueue;
|
||||
|
||||
typedef int (*vhost_backend_init)(struct vhost_dev *dev, void *opaque);
|
||||
typedef int (*vhost_backend_init)(struct vhost_dev *dev, void *opaque,
|
||||
Error **errp);
|
||||
typedef int (*vhost_backend_cleanup)(struct vhost_dev *dev);
|
||||
typedef int (*vhost_backend_memslots_limit)(struct vhost_dev *dev);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue