Received: from eggs.gnu.org ([2001:4830:134:3::10]:50033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFwFH-00036e-Ko for qemu-devel@nongnu.org; Thu, 23 Jun 2016 00:28:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFwFG-0001w5-MP for qemu-devel@nongnu.org; Thu, 23 Jun 2016 00:28:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55595) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFwFG-0001w1-Gq for qemu-devel@nongnu.org; Thu, 23 Jun 2016 00:28:02 -0400 Date: Thu, 23 Jun 2016 07:27:58 +0300 From: "Michael S. Tsirkin" Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1466503372-28334-9-git-send-email-marcandre.lureau@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: marcandre.lureau@redhat.com Cc: qemu-devel@nongnu.org, mukawa@igel.co.jp, yuanhan.liu@linux.intel.com, victork@redhat.com, jonshin@cisco.com On Tue, Jun 21, 2016 at 12:02:36PM +0200, marcandre.lureau@redhat.com wro= te: > From: Marc-Andr=E9 Lureau >=20 > Return read errors (not sure why those were ignored) >=20 > Signed-off-by: Marc-Andr=E9 Lureau why bother? So callers can just ignore them in turn? > --- > 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) { > --=20 > 2.7.4