>From db0f41a843004157fd1181082716f83879f518ca Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 11 Nov 2008 17:31:55 +0100 Subject: [PATCH] Fix qemu hang in block layer. Without s->rfd being non-blocking qemu hangs in posix_aio_read() due to the read() syscall blocking. Signed-off-by: Gerd Hoffmann --- block-raw-posix.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/block-raw-posix.c b/block-raw-posix.c index c06e38d..a08a773 100644 --- a/block-raw-posix.c +++ b/block-raw-posix.c @@ -591,6 +591,7 @@ static int posix_aio_init(void) s->rfd = fds[0]; s->wfd = fds[1]; + fcntl(s->rfd, F_SETFL, O_NONBLOCK); fcntl(s->wfd, F_SETFL, O_NONBLOCK); qemu_aio_set_fd_handler(s->rfd, posix_aio_read, NULL, posix_aio_flush, s); -- 1.5.6.5