From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39529) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WO6S2-0006EJ-R3 for qemu-devel@nongnu.org; Thu, 13 Mar 2014 10:17:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WO6S1-0000No-TI for qemu-devel@nongnu.org; Thu, 13 Mar 2014 10:17:38 -0400 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:46687) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WO6S1-0000MP-Lv for qemu-devel@nongnu.org; Thu, 13 Mar 2014 10:17:37 -0400 From: Peter Maydell Date: Thu, 13 Mar 2014 14:17:29 +0000 Message-Id: <1394720249-13318-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH] main-loop: Suppress "I/O thread spun" warnings for qtest List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= , Stefan Hajnoczi , patches@linaro.org When running under qtest we don't actually have any vcpu threads to be starved, so the warning about the I/O thread spinning isn't relevant, and the way qtest manipulates the simulated clock means the warning is produced a lot as a false positive. Suppress it if qtest_enabled(), so 'make check' output is less noisy. Signed-off-by: Peter Maydell --- main-loop.c | 3 ++- stubs/Makefile.objs | 1 + stubs/qtest.c | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 stubs/qtest.c diff --git a/main-loop.c b/main-loop.c index c3c9c28..8a85493 100644 --- a/main-loop.c +++ b/main-loop.c @@ -25,6 +25,7 @@ #include "qemu-common.h" #include "qemu/timer.h" #include "qemu/sockets.h" // struct in_addr needed for libslirp.h +#include "sysemu/qtest.h" #include "slirp/libslirp.h" #include "qemu/main-loop.h" #include "block/aio.h" @@ -208,7 +209,7 @@ static int os_host_main_loop_wait(int64_t timeout) if (!timeout && (spin_counter > MAX_MAIN_LOOP_SPIN)) { static bool notified; - if (!notified) { + if (!notified && !qtest_enabled()) { fprintf(stderr, "main-loop: WARNING: I/O thread spun for %d iterations\n", MAX_MAIN_LOOP_SPIN); diff --git a/stubs/Makefile.objs b/stubs/Makefile.objs index df3aa7a..6f06fca 100644 --- a/stubs/Makefile.objs +++ b/stubs/Makefile.objs @@ -28,3 +28,4 @@ stub-obj-y += vmstate.o stub-obj-$(CONFIG_WIN32) += fd-register.o stub-obj-y += cpus.o stub-obj-y += kvm.o +stub-obj-y += qtest.o diff --git a/stubs/qtest.c b/stubs/qtest.c new file mode 100644 index 0000000..e671ed8 --- /dev/null +++ b/stubs/qtest.c @@ -0,0 +1,14 @@ +/* + * qtest stubs + * + * Copyright (c) 2014 Linaro Limited + * Written by Peter Maydell + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include "qemu-common.h" + +/* Needed for qtest_allowed() */ +bool qtest_allowed; -- 1.9.0