From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37577) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn7hd-0005l7-8o for qemu-devel@nongnu.org; Thu, 22 Sep 2016 13:22:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn7hb-0002gm-3n for qemu-devel@nongnu.org; Thu, 22 Sep 2016 13:22:28 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:47096) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn7ha-0002fm-Tn for qemu-devel@nongnu.org; Thu, 22 Sep 2016 13:22:27 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1bn7ha-0007IL-Fx for qemu-devel@nongnu.org; Thu, 22 Sep 2016 18:22:26 +0100 From: Peter Maydell Date: Thu, 22 Sep 2016 18:21:57 +0100 Message-Id: <1474564935-23831-19-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1474564935-23831-1-git-send-email-peter.maydell@linaro.org> References: <1474564935-23831-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PULL 18/36] hw/ptimer: Suppress error messages under qtest List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: Dmitry Osipenko Under qtest ptimer emits lots of warning messages. The messages are caused by the actual checking of the ptimer error conditions. Suppress those messages, so they do not distract. Signed-off-by: Dmitry Osipenko Message-id: 44877fff4ff03205590698d3dc189ad6d091472f.1473252818.git.digetx@gmail.com Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/core/ptimer.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hw/core/ptimer.c b/hw/core/ptimer.c index 00fdf15..c45c835 100644 --- a/hw/core/ptimer.c +++ b/hw/core/ptimer.c @@ -11,6 +11,7 @@ #include "hw/ptimer.h" #include "qemu/host-utils.h" #include "sysemu/replay.h" +#include "sysemu/qtest.h" struct ptimer_state { @@ -44,7 +45,9 @@ static void ptimer_reload(ptimer_state *s) s->delta = s->limit; } if (s->delta == 0 || s->period == 0) { - fprintf(stderr, "Timer with period zero, disabling\n"); + if (!qtest_enabled()) { + fprintf(stderr, "Timer with period zero, disabling\n"); + } timer_del(s->timer); s->enabled = 0; return; @@ -163,7 +166,9 @@ void ptimer_run(ptimer_state *s, int oneshot) bool was_disabled = !s->enabled; if (was_disabled && s->period == 0) { - fprintf(stderr, "Timer with period zero, disabling\n"); + if (!qtest_enabled()) { + fprintf(stderr, "Timer with period zero, disabling\n"); + } return; } s->enabled = oneshot ? 2 : 1; -- 2.7.4