From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49180) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahCwB-0006df-BG for qemu-devel@nongnu.org; Sat, 19 Mar 2016 05:12:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ahCw6-0004gj-CU for qemu-devel@nongnu.org; Sat, 19 Mar 2016 05:12:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55608) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahCw6-0004g4-7j for qemu-devel@nongnu.org; Sat, 19 Mar 2016 05:12:42 -0400 References: <1458324041-22709-1-git-send-email-berrange@redhat.com> From: Paolo Bonzini Message-ID: <56ED1805.8050305@redhat.com> Date: Sat, 19 Mar 2016 10:12:37 +0100 MIME-Version: 1.0 In-Reply-To: <1458324041-22709-1-git-send-email-berrange@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] char: ensure all clients are in non-blocking mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" , qemu-devel@nongnu.org Cc: Laurent Vivier , Andrew Baumann On 18/03/2016 19:00, Daniel P. Berrange wrote: > 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 bfcf80d..144764e 100644 > --- a/qemu-char.c > +++ b/qemu-char.c > @@ -3071,6 +3071,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); > } > @@ -3102,7 +3104,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; > Thanks, queued. Paolo