qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [5636] Run timers from host alarm timer callback
Date: Wed, 05 Nov 2008 21:04:35 +0000	[thread overview]
Message-ID: <E1KxpYJ-0001Cj-Mu@cvs.savannah.gnu.org> (raw)

Revision: 5636
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5636
Author:   aliguori
Date:     2008-11-05 21:04:35 +0000 (Wed, 05 Nov 2008)

Log Message:
-----------
Run timers from host alarm timer callback

This further cleans up the main loop getting it a lot closer to what a main
loop should be.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

Modified Paths:
--------------
    trunk/vl.c

Modified: trunk/vl.c
===================================================================
--- trunk/vl.c	2008-11-05 20:49:37 UTC (rev 5635)
+++ trunk/vl.c	2008-11-05 21:04:35 UTC (rev 5636)
@@ -1700,6 +1700,15 @@
         len = read(alarm_timer_rfd, buffer, sizeof(buffer));
     } while ((len == -1 && errno == EINTR) || len > 0);
 
+    /* vm time timers */
+    if (vm_running && likely(!(cur_cpu->singlestep_enabled & SSTEP_NOTIMER)))
+        qemu_run_timers(&active_timers[QEMU_TIMER_VIRTUAL],
+                        qemu_get_clock(vm_clock));
+
+    /* real time timers */
+    qemu_run_timers(&active_timers[QEMU_TIMER_REALTIME],
+                    qemu_get_clock(rt_clock));
+
     if (t->flags & ALARM_FLAG_EXPIRED) {
         alarm_timer->flags &= ~ALARM_FLAG_EXPIRED;
         qemu_rearm_alarm_timer(alarm_timer);
@@ -4551,16 +4560,6 @@
     }
 #endif
 
-    if (vm_running) {
-        if (likely(!(cur_cpu->singlestep_enabled & SSTEP_NOTIMER)))
-        qemu_run_timers(&active_timers[QEMU_TIMER_VIRTUAL],
-                        qemu_get_clock(vm_clock));
-    }
-
-    /* real time timers */
-    qemu_run_timers(&active_timers[QEMU_TIMER_REALTIME],
-                    qemu_get_clock(rt_clock));
-
     /* Check bottom-halves last in case any of the earlier events triggered
        them.  */
     qemu_bh_poll();

             reply	other threads:[~2008-11-05 21:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-05 21:04 Anthony Liguori [this message]
2008-11-05 21:08 ` [Qemu-devel] [5636] Run timers from host alarm timer callback Anthony Liguori
2008-11-07 11:52   ` Luis Pureza
2008-11-07 14:06     ` Anthony Liguori
2008-11-07 16:23       ` Paul Brook
2008-11-11 21:00       ` Anthony Liguori
2008-11-11 23:42         ` Luis Pureza

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=E1KxpYJ-0001Cj-Mu@cvs.savannah.gnu.org \
    --to=anthony@codemonkey.ws \
    --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).