qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH, RFC] qemu-timer: fix alarm_timer pending
@ 2010-03-19  5:24 TeLeMan
  2010-03-19  9:33 ` [Qemu-devel] " Paolo Bonzini
  0 siblings, 1 reply; 5+ messages in thread
From: TeLeMan @ 2010-03-19  5:24 UTC (permalink / raw)
  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 <geleman@gmail.com>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-27 13:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-19  5:24 [Qemu-devel] [PATCH, RFC] qemu-timer: fix alarm_timer pending TeLeMan
2010-03-19  9:33 ` [Qemu-devel] " Paolo Bonzini
2010-03-19  9:47   ` TeLeMan
2010-03-19 10:30     ` [Qemu-devel] [PATCH] fix race between timer firing vs. alarm_timer->pending = 0 Paolo Bonzini
2010-03-27 13:05       ` Aurelien Jarno

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).