qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 3/3] icount: print a warning if there is no more dea


From: Victor CLEMENT
Subject: [Qemu-devel] [PATCH 3/3] icount: print a warning if there is no more deadline in no_rt mode
Date: Wed, 27 May 2015 13:52:03 +0200

While qemu is running in icount_no_rt 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 <address@hidden>
---
 cpus.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/cpus.c b/cpus.c
index eac3e19..c358c2e 100644
--- a/cpus.c
+++ b/cpus.c
@@ -419,6 +419,12 @@ 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_no_rt && !notified) {
+            fprintf(stderr, "cpus: WARNING: icount no_rt enabled and no more \
+active timer\n");
+            notified = true;
+        }
         return;
     }
 
-- 
2.3.7




reply via email to

[Prev in Thread] Current Thread [Next in Thread]