diff --git a/tests/unit/test-nested-aio-poll.c b/tests/unit/test-nested-aio-poll.c index db33742af3bf19c07c76c4035d1e370933a4cc4e..cd1c4d15c86724f4dabfc9437851c31cd605601c 100644 --- a/tests/unit/test-nested-aio-poll.c +++ b/tests/unit/test-nested-aio-poll.c @@ -15,6 +15,7 @@ #include "qemu/osdep.h" #include "block/aio.h" #include "qapi/error.h" +#include "util/aio-posix.h" typedef struct { AioContext *ctx; @@ -78,17 +79,17 @@ static void test(void) .ctx = aio_context_new(&error_abort), }; + if (td.ctx->fdmon_ops != &fdmon_poll_ops) { + /* This test is tied to fdmon-poll.c */ + g_test_skip("fdmon_poll_ops not in use"); + return; + } + qemu_set_current_aio_context(td.ctx); /* Enable polling */ aio_context_set_poll_params(td.ctx, 1000000, 2, 2, &error_abort); - /* - * The GSource is unused but this has the side-effect of changing the fdmon - * that AioContext uses. - */ - aio_get_g_source(td.ctx); - /* Make the event notifier active (set) right away */ event_notifier_init(&td.poll_notifier, 1); aio_set_event_notifier(td.ctx, &td.poll_notifier,