qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [patch] Fix block I/O hang.
Date: Tue, 11 Nov 2008 17:35:56 +0100	[thread overview]
Message-ID: <4919B46C.3040804@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 48 bytes --]

  Hi,

$subject says all.

please apply,
  Gerd

[-- Attachment #2: 0050-Fix-qemu-hang-in-block-layer.patch --]
[-- Type: text/plain, Size: 836 bytes --]

>From db0f41a843004157fd1181082716f83879f518ca Mon Sep 17 00:00:00 2001
From: Gerd Hoffmann <kraxel@redhat.com>
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 <kraxel@redhat.com>
---
 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


             reply	other threads:[~2008-11-11 16:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-11 16:35 Gerd Hoffmann [this message]
2008-11-11 16:49 ` [Qemu-devel] [patch] Fix block I/O hang Anthony Liguori
2008-11-11 17:48   ` Gerd Hoffmann
2008-11-11 17:55     ` Anthony Liguori
2008-11-11 20:51       ` Gerd Hoffmann
2008-11-11 21:07         ` Anthony Liguori
2008-11-11 21:34           ` Gerd Hoffmann
2008-11-12 13:49     ` Johannes Stezenbach
2008-11-12 14:58       ` Anthony Liguori
2008-11-12 15:01       ` Gerd Hoffmann
2008-11-12 13:03   ` Gerd Hoffmann
2008-11-12 14:57     ` Anthony Liguori
2008-11-13  9:14       ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4919B46C.3040804@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).