From c3ff757d25115d6a530e8859d7287a862b1dc02d Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 30 Sep 2016 15:34:24 +0100 Subject: main: set names for main loop sources created The main loop creates two generic sources for the AIO and IO handler systems. Acked-by: Paolo Bonzini Reviewed-by: Stefan Hajnoczi Signed-off-by: Daniel P. Berrange --- main-loop.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'main-loop.c') diff --git a/main-loop.c b/main-loop.c index 6a7f8d30bd..66c4eb69a3 100644 --- a/main-loop.c +++ b/main-loop.c @@ -161,9 +161,11 @@ int qemu_init_main_loop(Error **errp) qemu_notify_bh = qemu_bh_new(notify_event_cb, NULL); gpollfds = g_array_new(FALSE, FALSE, sizeof(GPollFD)); src = aio_get_g_source(qemu_aio_context); + g_source_set_name(src, "aio-context"); g_source_attach(src, NULL); g_source_unref(src); src = iohandler_get_g_source(); + g_source_set_name(src, "io-handler"); g_source_attach(src, NULL); g_source_unref(src); return 0; -- cgit v1.2.3 From 7d175d29c9430fcba7a98f2c71925137b7870da4 Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Mon, 17 Oct 2016 20:09:39 +0200 Subject: main-loop: Suppress I/O thread warning under qtest We do not want to display the "I/O thread spun" warning for test cases that run under qtest. The first attempt for this (commit 01c22f2cdd4fcf02276ea10f48253850a5fd7259) tested whether qtest_enabled() was true. Commit 21a24302e85024dd7b2a151158adbc1f5dc5c4dd correctly recognized that just testing qtest_enabled() is not sufficient since there are some tests that do not use the qtest accelerator but just the qtest character device, and thus replaced qtest_enabled() by qtest_driver(). However, there are also some tests that only use the qtest accelerator and not the qtest chardev; perhaps most notably the bash iotests. Therefore, we have to check both qtest_enabled() and qtest_driver(). Signed-off-by: Max Reitz Message-Id: <20161017180939.27912-1-mreitz@redhat.com> Signed-off-by: Paolo Bonzini --- main-loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main-loop.c') diff --git a/main-loop.c b/main-loop.c index 66c4eb69a3..ad10bca211 100644 --- a/main-loop.c +++ b/main-loop.c @@ -234,7 +234,7 @@ static int os_host_main_loop_wait(int64_t timeout) if (!timeout && (spin_counter > MAX_MAIN_LOOP_SPIN)) { static bool notified; - if (!notified && !qtest_driver()) { + if (!notified && !qtest_enabled() && !qtest_driver()) { fprintf(stderr, "main-loop: WARNING: I/O thread spun for %d iterations\n", MAX_MAIN_LOOP_SPIN); -- cgit v1.2.3