Skip to content

Commit

Permalink
main-loop: Suppress "I/O thread spun" warnings for qtest
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Andreas Färber <[email protected]>
  • Loading branch information
pm215 authored and afaerber committed Mar 13, 2014
1 parent cb201b4 commit 01c22f2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main-loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions stubs/Makefile.objs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 14 additions & 0 deletions stubs/qtest.c
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 01c22f2

Please sign in to comment.