]> git.proxmox.com Git - mirror_qemu.git/blobdiff - main-loop.c
tests/vhost-user-bridge: fix build on 32 bit systems
[mirror_qemu.git] / main-loop.c
index db600a37f1570f281000b3b897e421e1d4016f9a..19beae76ad1ab533febfac85d79bd46b9ec38a42 100644 (file)
@@ -22,6 +22,7 @@
  * THE SOFTWARE.
  */
 
+#include "qemu/osdep.h"
 #include "qemu-common.h"
 #include "qemu/timer.h"
 #include "qemu/sockets.h"      // struct in_addr needed for libslirp.h
@@ -230,7 +231,7 @@ static int os_host_main_loop_wait(int64_t timeout)
     if (!timeout && (spin_counter > MAX_MAIN_LOOP_SPIN)) {
         static bool notified;
 
-        if (!notified && !qtest_enabled()) {
+        if (!notified && !qtest_driver()) {
             fprintf(stderr,
                     "main-loop: WARNING: I/O thread spun for %d iterations\n",
                     MAX_MAIN_LOOP_SPIN);
@@ -506,6 +507,9 @@ int main_loop_wait(int nonblocking)
     slirp_pollfds_poll(gpollfds, (ret < 0));
 #endif
 
+    /* CPU thread can infinitely wait for event after
+       missing the warp */
+    qemu_clock_warp(QEMU_CLOCK_VIRTUAL);
     qemu_clock_run_all_timers();
 
     return ret;