Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KJqaH-0005Gm-5W for qemu-devel@nongnu.org; Fri, 18 Jul 2008 10:05:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KJqaG-0005GA-0D for qemu-devel@nongnu.org; Fri, 18 Jul 2008 10:05:20 -0400 Received: from [199.232.76.173] (port=47959 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KJqaF-0005G7-R4 for qemu-devel@nongnu.org; Fri, 18 Jul 2008 10:05:19 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:43956) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KJqaF-0005Jp-A7 for qemu-devel@nongnu.org; Fri, 18 Jul 2008 10:05:19 -0400 Received: from mariner.uk.xensource.com ([10.80.2.22]) by smtp01.ad.xensource.com (8.13.1/8.13.1) with ESMTP id m6IE5G9H025471 for ; Fri, 18 Jul 2008 07:05:17 -0700 Received: from iwj by mariner.uk.xensource.com with local (Exim 4.63) (envelope-from ) id 1KJqa3-00067A-KN for qemu-devel@nongnu.org; Fri, 18 Jul 2008 15:05:07 +0100 From: Ian Jackson Date: Fri, 18 Jul 2008 14:24:17 +0100 Message-Id: Subject: [Qemu-devel] [PATCH 2/3] Always use nonblocking mode for qemu_chr_open_fd. Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org The rest of qemu assumes that IO operations on a CharDriverState do not block. Currently there are a couple of cases where such a driver was set up but the calls to set nonblocking mode were missing: * qemu_chr_open_pty * qemu_chr_open_pipe * qemu_chr_open_stdio This is fixed by adding two calls to socket_set_nonblock to qemu_chr_open_fd. Signed-off-by: Ian Jackson --- vl.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/vl.c b/vl.c index 4f31288..c428c7e 100644 --- a/vl.c +++ b/vl.c @@ -2090,6 +2090,9 @@ static CharDriverState *qemu_chr_open_fd(int fd_in, int fd_out) CharDriverState *chr; FDCharDriver *s; + socket_set_nonblock(fd_in); + socket_set_nonblock(fd_out); + chr = qemu_mallocz(sizeof(CharDriverState)); if (!chr) return NULL; -- 1.4.4.4