Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NsUhU-00070U-4Q for qemu-devel@nongnu.org; Fri, 19 Mar 2010 01:24:48 -0400 Received: from [199.232.76.173] (port=43677 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NsUhS-0006zo-RZ for qemu-devel@nongnu.org; Fri, 19 Mar 2010 01:24:46 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NsUhS-0004Cr-4d for qemu-devel@nongnu.org; Fri, 19 Mar 2010 01:24:46 -0400 Received: from mail-px0-f176.google.com ([209.85.216.176]:64410) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NsUhR-0004Ck-R0 for qemu-devel@nongnu.org; Fri, 19 Mar 2010 01:24:46 -0400 Received: by pxi6 with SMTP id 6so2013772pxi.18 for ; Thu, 18 Mar 2010 22:24:44 -0700 (PDT) MIME-Version: 1.0 Date: Fri, 19 Mar 2010 13:24:44 +0800 Message-ID: From: TeLeMan Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] [PATCH, RFC] qemu-timer: fix alarm_timer pending List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel , Paolo Bonzini Cc: Anthony Liguori I fetched the lastest qemu-timer codes and found qemu would have no response when the guest os was WinXP and the timer was "dynticks" on the win32 host. After qemu froze, it seemed the win32_rearm_timer() would never be called and alarm_timer->pending was always 0. I could not find the more deeper reason and just referred to the previous implement to make this patch. Signed-off-by: TeLeMan --- qemu-timer.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/qemu-timer.c b/qemu-timer.c index 3d6e99a..f9e2b19 100644 --- a/qemu-timer.c +++ b/qemu-timer.c @@ -280,7 +280,12 @@ static struct qemu_alarm_timer *alarm_timer; int qemu_alarm_pending(void) { - return alarm_timer->pending; + if(alarm_timer->pending) { + alarm_timer->pending = 0; + return 1; + } + + return 0; } static inline int alarm_has_dynticks(struct qemu_alarm_timer *t) @@ -724,8 +729,6 @@ void qemu_run_all_timers(void) qemu_rearm_alarm_timer(alarm_timer); } - alarm_timer->pending = 0; - /* vm time timers */ if (vm_running) { qemu_run_timers(vm_clock); -- 1.6.5.1.1367.gcd48 -- SUN OF A BEACH