From nobody Mon Feb 9 16:18:59 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500631503088362.49941143432864; Fri, 21 Jul 2017 03:05:03 -0700 (PDT) Received: from localhost ([::1]:42051 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYUhN-0005H8-TP for importer@patchew.org; Fri, 21 Jul 2017 05:58:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dYUfq-0004EA-4m for qemu-devel@nongnu.org; Fri, 21 Jul 2017 05:56:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dYUfn-0000vW-2V for qemu-devel@nongnu.org; Fri, 21 Jul 2017 05:56:42 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56632) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dYUfm-0000v5-SJ for qemu-devel@nongnu.org; Fri, 21 Jul 2017 05:56:38 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BCAB02C1552 for ; Fri, 21 Jul 2017 09:56:37 +0000 (UTC) Received: from localhost (dhcp-192-218.str.redhat.com [10.33.192.218]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4CD6C81740; Fri, 21 Jul 2017 09:56:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BCAB02C1552 Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jfreimann@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com BCAB02C1552 From: Jens Freimann To: qemu-devel@nongnu.org Date: Fri, 21 Jul 2017 11:55:52 +0200 Message-Id: <20170721095553.10717-4-jfreimann@redhat.com> In-Reply-To: <20170721095553.10717-1-jfreimann@redhat.com> References: <20170721095553.10717-1-jfreimann@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 21 Jul 2017 09:56:37 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 3/4] libvhost-user: quit when no more data received X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: marcandre.lureau@redhat.com, maxime.coquelin@redhat.com, victork@redhat.com, stefanha@redhat.com, mst@redhat.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Jens Freimann End processing of messages when VHOST_USER_NO_MESSAGE is received. Without this we run into a vubr_panic() call and get "PANIC: Unhandled request: 0" Signed-off-by: Jens Freimann --- contrib/libvhost-user/libvhost-user.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/libvhost-user/libvhost-user.c b/contrib/libvhost-user/= libvhost-user.c index 9efb9da..85523ca 100644 --- a/contrib/libvhost-user/libvhost-user.c +++ b/contrib/libvhost-user/libvhost-user.c @@ -161,7 +161,7 @@ vu_message_read(VuDev *dev, int conn_fd, VhostUserMsg *= vmsg) rc =3D recvmsg(conn_fd, &msg, 0); } while (rc < 0 && (errno =3D=3D EINTR || errno =3D=3D EAGAIN)); =20 - if (rc <=3D 0) { + if (rc < 0) { vu_panic(dev, "Error while recvmsg: %s", strerror(errno)); return false; } @@ -806,6 +806,8 @@ vu_process_message(VuDev *dev, VhostUserMsg *vmsg) return vu_get_queue_num_exec(dev, vmsg); case VHOST_USER_SET_VRING_ENABLE: return vu_set_vring_enable_exec(dev, vmsg); + case VHOST_USER_NONE: + return true; default: vmsg_close_fds(vmsg); vu_panic(dev, "Unhandled request: %d", vmsg->request); --=20 2.9.4