From: "Andreas Färber" <afaerber@suse.de>
To: qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
"Andreas Färber" <afaerber@suse.de>
Subject: [Qemu-devel] [PULL for-2.0 4/4] main-loop: Suppress "I/O thread spun" warnings for qtest
Date: Thu, 13 Mar 2014 21:47:15 +0100 [thread overview]
Message-ID: <1394743636-23848-5-git-send-email-afaerber@suse.de> (raw)
In-Reply-To: <1394743636-23848-1-git-send-email-afaerber@suse.de>
From: Peter Maydell <peter.maydell@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 <peter.maydell@linaro.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
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..59c5a54 100644
--- a/stubs/Makefile.objs
+++ b/stubs/Makefile.objs
@@ -18,6 +18,7 @@ stub-obj-y += mon-print-filename.o
stub-obj-y += mon-protocol-event.o
stub-obj-y += mon-set-error.o
stub-obj-y += pci-drive-hot-add.o
+stub-obj-y += qtest.o
stub-obj-y += reset.o
stub-obj-y += set-fd-handler.o
stub-obj-y += slirp.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.8.4.5
next prev parent reply other threads:[~2014-03-13 20:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-13 20:47 [Qemu-devel] [PULL for-2.0 0/4] QOM devices patch queue 2014-03-13 Andreas Färber
2014-03-13 20:47 ` [Qemu-devel] [PULL for-2.0 1/4] virtio-console: Fix VIRTIO_CONSOLE() cast macro Andreas Färber
2014-03-13 20:47 ` [Qemu-devel] [PULL for-2.0 2/4] virtio-console-test: Test virtserialport as well Andreas Färber
2014-03-13 20:47 ` [Qemu-devel] [PULL for-2.0 3/4] qtest: Fix crash if SIGABRT during qtest_init() Andreas Färber
2014-03-13 20:47 ` Andreas Färber [this message]
2014-03-13 22:14 ` [Qemu-devel] [PULL for-2.0 0/4] QOM devices patch queue 2014-03-13 Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1394743636-23848-5-git-send-email-afaerber@suse.de \
--to=afaerber@suse.de \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).