From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aldbv-0004GG-7F for qemu-devel@nongnu.org; Thu, 31 Mar 2016 10:30:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aldbr-0008NR-6d for qemu-devel@nongnu.org; Thu, 31 Mar 2016 10:30:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aldbr-0008N7-1f for qemu-devel@nongnu.org; Thu, 31 Mar 2016 10:30:07 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B4E8720CFF for ; Thu, 31 Mar 2016 14:30:06 +0000 (UTC) From: "Daniel P. Berrange" Date: Thu, 31 Mar 2016 15:29:57 +0100 Message-Id: <1459434597-31255-3-git-send-email-berrange@redhat.com> In-Reply-To: <1459434597-31255-1-git-send-email-berrange@redhat.com> References: <1459434597-31255-1-git-send-email-berrange@redhat.com> Subject: [Qemu-devel] [PATCH 2/2] char: ensure all clients are in non-blocking mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Paolo Bonzini Only some callers of tcp_chr_new_client are putting the socket client into non-blocking mode. Move the call to qio_channel_set_blocking() into the tcp_chr_new_client method to guarantee that all code paths set non-blocking mode Reported-by: Andrew Baumann Reported-by: Laurent Vivier Signed-off-by: Daniel P. Berrange --- qemu-char.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qemu-char.c b/qemu-char.c index 6e623c3..3558429 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -3081,6 +3081,8 @@ static int tcp_chr_new_client(CharDriverState *chr, QIOChannelSocket *sioc) s->sioc = sioc; object_ref(OBJECT(sioc)); + qio_channel_set_blocking(s->ioc, false, NULL); + if (s->do_nodelay) { qio_channel_set_delay(s->ioc, false); } @@ -3112,7 +3114,6 @@ static int tcp_chr_add_client(CharDriverState *chr, int fd) if (!sioc) { return -1; } - qio_channel_set_blocking(QIO_CHANNEL(sioc), false, NULL); ret = tcp_chr_new_client(chr, sioc); object_unref(OBJECT(sioc)); return ret; -- 2.5.5