Received: from eggs.gnu.org ([2001:4830:134:3::10]:46314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFIWV-00059O-C8 for qemu-devel@nongnu.org; Tue, 21 Jun 2016 06:03:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFIWP-0000H6-Ew for qemu-devel@nongnu.org; Tue, 21 Jun 2016 06:03:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFIWP-0000H0-9S for qemu-devel@nongnu.org; Tue, 21 Jun 2016 06:03:05 -0400 From: marcandre.lureau@redhat.com Date: Tue, 21 Jun 2016 12:02:36 +0200 Message-Id: <1466503372-28334-9-git-send-email-marcandre.lureau@redhat.com> In-Reply-To: <1466503372-28334-1-git-send-email-marcandre.lureau@redhat.com> References: <1466503372-28334-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 08/24] vhost-user: return a read error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mukawa@igel.co.jp, yuanhan.liu@linux.intel.com, victork@redhat.com, jonshin@cisco.com, mst@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-Andr=C3=A9 Lureau Return read errors (not sure why those were ignored) Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/virtio/vhost-user.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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_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) { --=20 2.7.4