From: Ian Jackson Date: Fri, 18 Jul 2008 13:24:17 +0000 (+0100) Subject: Always use nonblocking mode for qemu_chr_open_fd. X-Git-Tag: xen-3.3.0-rc1~20^2~2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=800b3dfade9c47728236d6c6c582375fce72f705;p=qemu-xen-4.0-testing.git Always use nonblocking mode for qemu_chr_open_fd. 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 --- diff --git a/vl.c b/vl.c index 4f31288f..c428c7e8 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;