From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36419) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adhv0-00007r-EI for qemu-devel@nongnu.org; Wed, 09 Mar 2016 12:29:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1adhuw-000601-KP for qemu-devel@nongnu.org; Wed, 09 Mar 2016 12:29:06 -0500 Received: from mx1.redhat.com ([209.132.183.28]:56959) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1adhuw-0005zx-FW for qemu-devel@nongnu.org; Wed, 09 Mar 2016 12:29:02 -0500 From: "Daniel P. Berrange" Date: Wed, 9 Mar 2016 17:28:16 +0000 Message-Id: <1457544504-8548-14-git-send-email-berrange@redhat.com> In-Reply-To: <1457544504-8548-1-git-send-email-berrange@redhat.com> References: <1457544504-8548-1-git-send-email-berrange@redhat.com> Subject: [Qemu-devel] [PATCH v1 13/21] char: ensure listener socket is in blocking mode when waiting List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini , Andrew Baumann , Stefan Weil When the network chardev is configured with 'server' and 'wait' options, QEMU must block startup until the first client connects to the server. This implies that the listener socket must be in blocking mode. Unfortnantely on Win32 the socket is initially in non-blocking mode, so we're not waiting for the first client. Signed-off-by: Daniel P. Berrange --- qemu-char.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qemu-char.c b/qemu-char.c index e0147f3..18890f7 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -4376,6 +4376,7 @@ static CharDriverState *qmp_chardev_open_socket(const char *id, if (is_listen && is_waitconnect) { fprintf(stderr, "QEMU waiting for connection on: %s\n", chr->filename); + qio_channel_set_blocking(QIO_CHANNEL(s->listen_ioc), true, NULL); tcp_chr_accept(QIO_CHANNEL(s->listen_ioc), G_IO_IN, chr); qio_channel_set_blocking(QIO_CHANNEL(s->listen_ioc), false, NULL); } -- 2.5.0