From: Marc-André Lureau Date: Mon, 6 Jun 2016 16:45:03 +0000 (+0200) Subject: vhost-user: disconnect on start failure X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0d572afd5266d1d67d132d06ea45d7246bcd6105;p=qemu.git vhost-user: disconnect on start failure If the backend failed to start (for example feature negociation failed), do not exit, but disconnect the char device instead. Slightly more robust for reconnect case. Signed-off-by: Marc-André Lureau Tested-by: Yuanhan Liu Reviewed-by: Yuanhan Liu Reviewed-by: Victor Kaplansky Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- diff --git a/net/vhost-user.c b/net/vhost-user.c index 4a7fd5fbd5..41ddb4b9ca 100644 --- a/net/vhost-user.c +++ b/net/vhost-user.c @@ -202,7 +202,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;