Received: from eggs.gnu.org ([2001:4830:134:3::10]:51297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG82i-0005zK-09 for qemu-devel@nongnu.org; Thu, 23 Jun 2016 13:03:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bG82d-00014f-0K for qemu-devel@nongnu.org; Thu, 23 Jun 2016 13:03:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38831) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG82c-00014R-Qa for qemu-devel@nongnu.org; Thu, 23 Jun 2016 13:03:46 -0400 Date: Thu, 23 Jun 2016 20:03:41 +0300 From: "Michael S. Tsirkin" Message-ID: <20160623200309-mutt-send-email-mst@redhat.com> References: <1466503372-28334-1-git-send-email-marcandre.lureau@redhat.com> <1466503372-28334-9-git-send-email-marcandre.lureau@redhat.com> <20160623072740-mutt-send-email-mst@redhat.com> <842458024.1343130.1466673244073.JavaMail.zimbra@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <842458024.1343130.1466673244073.JavaMail.zimbra@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 08/24] vhost-user: return a read error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?iso-8859-1?Q?Marc-Andr=E9?= Lureau Cc: marcandre lureau , qemu-devel@nongnu.org, mukawa@igel.co.jp, yuanhan liu , victork@redhat.com, jonshin@cisco.com On Thu, Jun 23, 2016 at 05:14:04AM -0400, Marc-Andr=E9 Lureau wrote: > Hi >=20 > ----- Original Message ----- > > On Tue, Jun 21, 2016 at 12:02:36PM +0200, marcandre.lureau@redhat.com= wrote: > > > From: Marc-Andr=E9 Lureau > > >=20 > > > Return read errors (not sure why those were ignored) > > >=20 > > > Signed-off-by: Marc-Andr=E9 Lureau > >=20 > > why bother? So callers can just ignore them in turn? >=20 > The callers do not always ignore errors, fortunately (see > vhost_user_init() for ex). But that doesn't call set log base, right? > That at least prevents flooding > terminal/monitor with multiple errors and helps finding out the origin > of the error. >=20 > >=20 > > > --- > > > hw/virtio/vhost-user.c | 6 +++--- > > > 1 file changed, 3 insertions(+), 3 deletions(-) > > >=20 > > > diff --git a/hw/virtio/vhost-user.c b/hw/virtio/vhost-user.c > > > index e51df27..819481d 100644 > > > --- a/hw/virtio/vhost-user.c > > > +++ b/hw/virtio/vhost-user.c > > > @@ -221,7 +221,7 @@ static int vhost_user_set_log_base(struct vhost= _dev > > > *dev, uint64_t base, > > > if (shmfd) { > > > msg.size =3D 0; > > > if (vhost_user_read(dev, &msg) < 0) { > > > - return 0; > > > + return -1; > > > } > > > =20 > > > if (msg.request !=3D VHOST_USER_SET_LOG_BASE) { > > > @@ -373,7 +373,7 @@ static int vhost_user_get_vring_base(struct vho= st_dev > > > *dev, > > > } > > > =20 > > > if (vhost_user_read(dev, &msg) < 0) { > > > - return 0; > > > + return -1; > > > } > > > =20 > > > if (msg.request !=3D VHOST_USER_GET_VRING_BASE) { > > > @@ -474,7 +474,7 @@ static int vhost_user_get_u64(struct vhost_dev = *dev, > > > int request, uint64_t *u64) > > > } > > > =20 > > > if (vhost_user_read(dev, &msg) < 0) { > > > - return 0; > > > + return -1; > > > } > > > =20 > > > if (msg.request !=3D request) { > > > -- > > > 2.7.4 > >=20