qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/7] vhost: Distinguish errors in vhost_backend_init()


From: Stefano Garzarella
Subject: Re: [PATCH 2/7] vhost: Distinguish errors in vhost_backend_init()
Date: Thu, 10 Jun 2021 11:07:39 +0200

On Wed, Jun 09, 2021 at 05:46:53PM +0200, Kevin Wolf wrote:
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>
---
include/hw/virtio/vhost-backend.h |  3 ++-
hw/virtio/vhost-backend.c         |  2 +-
hw/virtio/vhost-user.c            | 41 ++++++++++++++++---------------
hw/virtio/vhost-vdpa.c            |  2 +-
hw/virtio/vhost.c                 | 13 +++++-----
5 files changed, 32 insertions(+), 29 deletions(-)

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]