From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58197) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyLzG-0002Bp-Uw for qemu-devel@nongnu.org; Fri, 29 May 2015 11:14:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YyLzC-0007Pb-VK for qemu-devel@nongnu.org; Fri, 29 May 2015 11:14:18 -0400 Received: from zimbra3.corp.accelance.fr ([2001:4080:204::2:8]:53898) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YyLzC-0007PI-Q8 for qemu-devel@nongnu.org; Fri, 29 May 2015 11:14:14 -0400 From: Victor CLEMENT Date: Fri, 29 May 2015 17:14:06 +0200 Message-Id: <1432912446-9811-4-git-send-email-victor.clement@openwide.fr> In-Reply-To: <1432912446-9811-1-git-send-email-victor.clement@openwide.fr> References: <1432912446-9811-1-git-send-email-victor.clement@openwide.fr> Subject: [Qemu-devel] [PATCH v2 3/3] icount: print a warning if there is no more deadline in sleep=no mode List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: francois.guerret@hotmail.fr, pbonzini@redhat.com, Victor CLEMENT , julien.viarddegalbert@openwide.fr 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 --- cpus.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cpus.c b/cpus.c index 4e90e63..aec17b6 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_sleep && !notified) { + fprintf(stderr, "cpus: WARNING: icount sleep disabled and no more \ +active timer\n"); + notified = true; + } return; } -- 2.4.2