qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: TeLeMan <geleman@gmail.com>
To: qemu-devel <qemu-devel@nongnu.org>, Paolo Bonzini <pbonzini@redhat.com>
Cc: Anthony Liguori <aliguori@us.ibm.com>
Subject: [Qemu-devel] [PATCH, RFC] qemu-timer: fix alarm_timer pending
Date: Fri, 19 Mar 2010 13:24:44 +0800	[thread overview]
Message-ID: <a38b25541003182224s6caa2bc5m8f9dd2e2b17fc934@mail.gmail.com> (raw)

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

             reply	other threads:[~2010-03-19  5:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-19  5:24 TeLeMan [this message]
2010-03-19  9:33 ` [Qemu-devel] Re: [PATCH, RFC] qemu-timer: fix alarm_timer pending 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

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=a38b25541003182224s6caa2bc5m8f9dd2e2b17fc934@mail.gmail.com \
    --to=geleman@gmail.com \
    --cc=aliguori@us.ibm.com \
    --cc=pbonzini@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).