Message ID | 8e1b90ecc59573c4c5e9fc4934b4e30476b43e2f.1297696986.git.mtosatti@redhat.com |
---|---|
State | New |
Headers | show |
diff --git a/vl.c b/vl.c index 30263d6..9c628f0 100644 --- a/vl.c +++ b/vl.c @@ -1402,18 +1402,21 @@ qemu_irq qemu_system_powerdown; static void main_loop(void) { + bool nonblocking = false; +#ifdef CONFIG_PROFILER + int64_t ti; +#endif int r; qemu_main_loop_start(); for (;;) { do { - bool nonblocking = false; -#ifdef CONFIG_PROFILER - int64_t ti; -#endif #ifndef CONFIG_IOTHREAD nonblocking = cpu_exec_all(); + if (!vm_can_run()) { + nonblocking = true; + } #endif #ifdef CONFIG_PROFILER ti = profile_getclock();