[PATCH v4 03/12] tests/unit: skip test-nested-aio-poll with io_uring

Stefan Hajnoczi posted 12 patches 5 months ago
Maintainers: Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Aarushi Mehta <mehta.aaru20@gmail.com>, Julia Suvorova <jusual@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Stefano Garzarella <sgarzare@redhat.com>, Fam Zheng <fam@euphon.net>, Paolo Bonzini <pbonzini@redhat.com>, Stefan Weil <sw@weilnetz.de>
There is a newer version of this series
[PATCH v4 03/12] tests/unit: skip test-nested-aio-poll with io_uring
Posted by Stefan Hajnoczi 5 months ago
test-nested-aio-poll relies on internal details of how fdmon-poll.c
handles AioContext polling. Skip it when other fdmon implementations are
in use.

Note that this test is only built on POSIX systems so it is safe to
include "util/aio-posix.h".

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
---
 tests/unit/test-nested-aio-poll.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/tests/unit/test-nested-aio-poll.c b/tests/unit/test-nested-aio-poll.c
index d8fd92c43b..45484e745b 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;
@@ -71,6 +72,12 @@ 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 */
-- 
2.51.0
Re: [PATCH v4 03/12] tests/unit: skip test-nested-aio-poll with io_uring
Posted by Kevin Wolf 4 months ago
Am 10.09.2025 um 19:56 hat Stefan Hajnoczi geschrieben:
> test-nested-aio-poll relies on internal details of how fdmon-poll.c
> handles AioContext polling. Skip it when other fdmon implementations are
> in use.
> 
> Note that this test is only built on POSIX systems so it is safe to
> include "util/aio-posix.h".
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>

Maybe give a specific example of what fails with other fdmon
implementations?

Could we change the test to downgrade to fdmon-poll instead of skipping
the test entirely?

Kevin
Re: [PATCH v4 03/12] tests/unit: skip test-nested-aio-poll with io_uring
Posted by Stefan Hajnoczi 3 months, 3 weeks ago
On Thu, Oct 09, 2025 at 04:20:48PM +0200, Kevin Wolf wrote:
> Am 10.09.2025 um 19:56 hat Stefan Hajnoczi geschrieben:
> > test-nested-aio-poll relies on internal details of how fdmon-poll.c
> > handles AioContext polling. Skip it when other fdmon implementations are
> > in use.
> > 
> > Note that this test is only built on POSIX systems so it is safe to
> > include "util/aio-posix.h".
> > 
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> > Reviewed-by: Eric Blake <eblake@redhat.com>
> 
> Maybe give a specific example of what fails with other fdmon
> implementations?

Yes, I'll update the commit description.

> Could we change the test to downgrade to fdmon-poll instead of skipping
> the test entirely?

I don't think so because io_uring is permanently enabled and there is no
way to switch back to ppoll at runtime.

Stefan