From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33345) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alx4d-0005xj-T7 for qemu-devel@nongnu.org; Fri, 01 Apr 2016 07:17:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alx4Z-0001p8-Vs for qemu-devel@nongnu.org; Fri, 01 Apr 2016 07:17:07 -0400 Received: from mail-qg0-x232.google.com ([2607:f8b0:400d:c04::232]:34370) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alx4Z-0001ow-RY for qemu-devel@nongnu.org; Fri, 01 Apr 2016 07:17:03 -0400 Received: by mail-qg0-x232.google.com with SMTP id n34so85424273qge.1 for ; Fri, 01 Apr 2016 04:17:03 -0700 (PDT) Sender: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= From: marcandre.lureau@redhat.com Date: Fri, 1 Apr 2016 13:16:22 +0200 Message-Id: <1459509388-6185-13-git-send-email-marcandre.lureau@redhat.com> In-Reply-To: <1459509388-6185-1-git-send-email-marcandre.lureau@redhat.com> References: <1459509388-6185-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH 12/18] vhost-user: disconnect on start failure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Yuanhan Liu , "Michael S. Tsirkin" , Ilya Maximets , jonshin@cisco.com, Tetsuya Mukawa , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-André Lureau If the backend failed to start (for example feature negociation failed), do not exit, but disconnect the char device instead. Signed-off-by: Marc-André Lureau --- net/vhost-user.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/vhost-user.c b/net/vhost-user.c index 3dae53c..54849e9 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -204,7 +204,8 @@ static void net_vhost_user_event(void *opaque, int event) s->watch = qemu_chr_fe_add_watch(s->chr, G_IO_HUP, net_vhost_user_watch, s); if (vhost_user_start(queues, ncs) < 0) { - exit(1); + qemu_chr_disconnect(s->chr); + return; } qmp_set_link(name, true, &err); break; -- 2.5.5