qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH, RFC] qemu-timer: fix alarm_timer pending


From: TeLeMan
Subject: [Qemu-devel] [PATCH, RFC] qemu-timer: fix alarm_timer pending
Date: Fri, 19 Mar 2010 13:24:44 +0800

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 <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]