From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kmu7o-0001Vq-Ob for qemu-devel@nongnu.org; Mon, 06 Oct 2008 13:44:04 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kmu7m-0001VD-OH for qemu-devel@nongnu.org; Mon, 06 Oct 2008 13:44:04 -0400 Received: from [199.232.76.173] (port=33691 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kmu7m-0001VA-HR for qemu-devel@nongnu.org; Mon, 06 Oct 2008 13:44:02 -0400 Received: from mail-gx0-f19.google.com ([209.85.217.19]:34521) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kmu7m-0007LI-8r for qemu-devel@nongnu.org; Mon, 06 Oct 2008 13:44:02 -0400 Received: by gxk12 with SMTP id 12so5901799gxk.10 for ; Mon, 06 Oct 2008 10:44:01 -0700 (PDT) Message-ID: <48EA4E5D.50708@codemonkey.ws> Date: Mon, 06 Oct 2008 12:43:57 -0500 From: Anthony Liguori MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030801070706080608040303" Subject: [Qemu-devel] [PATCH][RFC] Fire SIGIO when IO requests are completed 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" , Blue Swirl This is a multi-part message in MIME format. --------------030801070706080608040303 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi Blue Swirl, Can you test the attached patch with sparc-softmmu? Better yet, do you have an image, or a recipe for an image that I could use to try and reproduce the problem? The sparc test code on the QEMU website just uses a ram disk so the regression isn't evident with it. Regards, Anthony Liguori --------------030801070706080608040303 Content-Type: text/x-patch; name="alarm.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="alarm.patch" diff --git a/block-raw-posix.c b/block-raw-posix.c index c0404fa..9b136ee 100644 --- a/block-raw-posix.c +++ b/block-raw-posix.c @@ -591,6 +591,12 @@ static int posix_aio_init(void) fcntl(s->fd, F_SETFL, O_NONBLOCK); + { + extern void enable_sigio_timer(int fd); + + enable_sigio_timer(s->fd); + } + qemu_aio_set_fd_handler(s->fd, posix_aio_read, NULL, posix_aio_flush, s); #if defined(__linux__) diff --git a/qemu-tool.c b/qemu-tool.c index 63e2056..c37fdea 100644 --- a/qemu-tool.c +++ b/qemu-tool.c @@ -26,6 +26,10 @@ struct QEMUBH void *opaque; }; +void enable_sigio_timer(int fd) +{ +} + void term_printf(const char *fmt, ...) { } diff --git a/vl.c b/vl.c index c94fdc0..8f66a90 100644 --- a/vl.c +++ b/vl.c @@ -1307,7 +1307,7 @@ static void host_alarm_handler(int host_signum) last_clock = ti; } #endif - if (alarm_has_dynticks(alarm_timer) || + if (1 || alarm_has_dynticks(alarm_timer) || (!use_icount && qemu_timer_expired(active_timers[QEMU_TIMER_VIRTUAL], qemu_get_clock(vm_clock))) || @@ -1383,7 +1383,7 @@ static uint64_t qemu_next_deadline_dyntick(void) #define RTC_FREQ 1024 -static void enable_sigio_timer(int fd) +void enable_sigio_timer(int fd) { struct sigaction act; @@ -1393,7 +1393,7 @@ static void enable_sigio_timer(int fd) act.sa_handler = host_alarm_handler; sigaction(SIGIO, &act, NULL); - fcntl(fd, F_SETFL, O_ASYNC); + fcntl(fd, F_SETFL, O_ASYNC | fcntl(fd, F_GETFL)); fcntl(fd, F_SETOWN, getpid()); } --------------030801070706080608040303--