From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KxpYL-0002BB-Sw for qemu-devel@nongnu.org; Wed, 05 Nov 2008 16:04:37 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KxpYL-0002AJ-85 for qemu-devel@nongnu.org; Wed, 05 Nov 2008 16:04:37 -0500 Received: from [199.232.76.173] (port=56168 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KxpYL-0002AB-2a for qemu-devel@nongnu.org; Wed, 05 Nov 2008 16:04:37 -0500 Received: from savannah.gnu.org ([199.232.41.3]:58010 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KxpYK-0001Nu-Un for qemu-devel@nongnu.org; Wed, 05 Nov 2008 16:04:37 -0500 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KxpYK-0001Cn-10 for qemu-devel@nongnu.org; Wed, 05 Nov 2008 21:04:36 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KxpYJ-0001Cj-Mu for qemu-devel@nongnu.org; Wed, 05 Nov 2008 21:04:35 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Wed, 05 Nov 2008 21:04:35 +0000 Subject: [Qemu-devel] [5636] Run timers from host alarm timer callback Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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 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();