]> git.proxmox.com Git - mirror_qemu.git/commitdiff
icount: print a warning if there is no more deadline in sleep=no mode
authorVictor CLEMENT <victor.clement@openwide.fr>
Fri, 29 May 2015 15:14:06 +0000 (17:14 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 5 Jun 2015 15:10:00 +0000 (17:10 +0200)
While qemu is running in sleep=no mode, a warning will be printed
when no timer deadline is set.
As this mode is intended for getting deterministic virtual time, if no
timer is set on the virtual clock this determinism is broken.

Signed-off-by: Victor CLEMENT <victor.clement@openwide.fr>
Message-Id: <1432912446-9811-4-git-send-email-victor.clement@openwide.fr>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
cpus.c

diff --git a/cpus.c b/cpus.c
index 4e90e63b43f917e70110a74aa82821cf16a22502..f38b858f9bb3aa47cb7e79a16494afeb6b9bc188 100644 (file)
--- a/cpus.c
+++ b/cpus.c
@@ -419,6 +419,11 @@ void qemu_clock_warp(QEMUClockType type)
     clock = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL_RT);
     deadline = qemu_clock_deadline_ns_all(QEMU_CLOCK_VIRTUAL);
     if (deadline < 0) {
+        static bool notified;
+        if (!icount_sleep && !notified) {
+            error_report("WARNING: icount sleep disabled and no active timers");
+            notified = true;
+        }
         return;
     }