]> xenbits.xensource.com Git - qemu-xen-3.3-testing.git/commitdiff
Always use nonblocking mode for qemu_chr_open_fd.
authorIan Jackson <iwj@mariner.uk.xensource.com>
Fri, 18 Jul 2008 13:24:17 +0000 (14:24 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 18 Jul 2008 13:36:56 +0000 (14:36 +0100)
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 <ian.jackson@eu.citrix.com>
vl.c

diff --git a/vl.c b/vl.c
index 4f31288fe712ecab2d7cb7394a6ca2242465d8e7..c428c7e8c694fb397d6c3952918542bc2a69a022 100644 (file)
--- 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;