Received: from eggs.gnu.org ([2001:4830:134:3::10]:33556) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG0iD-0007mL-He for qemu-devel@nongnu.org; Thu, 23 Jun 2016 05:14:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bG0i9-0003dS-Ef for qemu-devel@nongnu.org; Thu, 23 Jun 2016 05:14:13 -0400 Received: from mx3-phx2.redhat.com ([209.132.183.24]:55500) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bG0i9-0003dG-6X for qemu-devel@nongnu.org; Thu, 23 Jun 2016 05:14:09 -0400 Date: Thu, 23 Jun 2016 05:14:04 -0400 (EDT) From: =?utf-8?Q?Marc-Andr=C3=A9?= Lureau Message-ID: <842458024.1343130.1466673244073.JavaMail.zimbra@redhat.com> In-Reply-To: <20160623072740-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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 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: "Michael S. Tsirkin" Cc: marcandre lureau , qemu-devel@nongnu.org, mukawa@igel.co.jp, yuanhan liu , victork@redhat.com, jonshin@cisco.com Hi ----- Original Message ----- > On Tue, Jun 21, 2016 at 12:02:36PM +0200, marcandre.lureau@redhat.com wro= te: > > From: Marc-Andr=C3=A9 Lureau > >=20 > > Return read errors (not sure why those were ignored) > >=20 > > Signed-off-by: Marc-Andr=C3=A9 Lureau >=20 > why bother? So callers can just ignore them in turn? The callers do not always ignore errors, fortunately (see vhost_user_init()= for ex). That at least prevents flooding terminal/monitor with multiple er= rors and helps finding out the origin of the error. >=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 vhost_d= ev > > *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