qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] fix halt emulation with icount and CONFIG_IOTHREAD
@ 2011-02-15 17:54 Marcelo Tosatti
  2011-02-15 18:58 ` [Qemu-devel] " Jan Kiszka
  0 siblings, 1 reply; 18+ messages in thread
From: Marcelo Tosatti @ 2011-02-15 17:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jan Kiszka, Edgar E. Iglesias


Note: to be applied to uq/master.

In icount mode, halt emulation should take into account the nearest event when sleeping.

Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Reported-and-tested-by: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>

diff --git a/cpus.c b/cpus.c
index 468544c..21c3eba 100644
--- a/cpus.c
+++ b/cpus.c
@@ -770,7 +770,7 @@ static void qemu_tcg_wait_io_event(void)
     CPUState *env;
 
     while (all_cpu_threads_idle()) {
-        qemu_cond_timedwait(tcg_halt_cond, &qemu_global_mutex, 1000);
+        qemu_cond_timedwait(tcg_halt_cond, &qemu_global_mutex, qemu_calculate_timeout());
     }
 
     qemu_mutex_unlock(&qemu_global_mutex);
diff --git a/vl.c b/vl.c
index b436952..8ba7e9d 100644
--- a/vl.c
+++ b/vl.c
@@ -1335,7 +1335,7 @@ void main_loop_wait(int nonblocking)
     if (nonblocking)
         timeout = 0;
     else {
-        timeout = qemu_calculate_timeout();
+        timeout = 1000;
         qemu_bh_update_timeout(&timeout);
     }
 

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

end of thread, other threads:[~2011-02-18 17:15 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-15 17:54 [Qemu-devel] [PATCH] fix halt emulation with icount and CONFIG_IOTHREAD Marcelo Tosatti
2011-02-15 18:58 ` [Qemu-devel] " Jan Kiszka
2011-02-15 20:04   ` Marcelo Tosatti
2011-02-15 20:33     ` Jan Kiszka
2011-02-15 20:55       ` Marcelo Tosatti
2011-02-15 20:56         ` [Qemu-devel] [PATCH] fix halt emulation with icount and CONFIG_IOTHREAD (v2) Marcelo Tosatti
2011-02-16  8:27           ` [Qemu-devel] " Jan Kiszka
2011-02-16  9:32           ` Paolo Bonzini
2011-02-16  9:46             ` Jan Kiszka
2011-02-16  9:57               ` Paolo Bonzini
2011-02-16 10:04                 ` Jan Kiszka
2011-02-16 10:27                   ` Paolo Bonzini
2011-02-16 10:34                     ` Jan Kiszka
2011-02-16 11:05                       ` Paolo Bonzini
2011-02-17  3:15             ` Marcelo Tosatti
2011-02-17  8:27               ` Paolo Bonzini
2011-02-18 17:13                 ` Paolo Bonzini
2011-02-17  8:29               ` Jan Kiszka

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