aboutsummaryrefslogtreecommitdiff
path: root/util/fdmon-io_uring.c
diff options
context:
space:
mode:
authorHaiyue Wang <haiyue.wang@intel.com>2022-02-22 00:24:01 +0800
committerStefan Hajnoczi <stefanha@redhat.com>2022-03-17 11:23:18 +0000
commit8a947c7a586e16a048894e1a0a73d154435e90ef (patch)
treec9bbcb0a66edfd447387c5f37fbab90983cf7141 /util/fdmon-io_uring.c
parent1d60bb4b14601e38ed17384277aa4c30c57925d3 (diff)
aio-posix: fix build failure io_uring 2.2
The io_uring fixed "Don't truncate addr fields to 32-bit on 32-bit": https://git.kernel.dk/cgit/liburing/commit/?id=d84c29b19ed0b130000619cff40141bb1fc3615b This leads to build failure: ../util/fdmon-io_uring.c: In function ‘add_poll_remove_sqe’: ../util/fdmon-io_uring.c:182:36: error: passing argument 2 of ‘io_uring_prep_poll_remove’ makes integer from pointer without a cast [-Werror=int-conversion] 182 | io_uring_prep_poll_remove(sqe, node); | ^~~~ | | | AioHandler * In file included from /root/io/qemu/include/block/aio.h:18, from ../util/aio-posix.h:20, from ../util/fdmon-io_uring.c:49: /usr/include/liburing.h:415:17: note: expected ‘__u64’ {aka ‘long long unsigned int’} but argument is of type ‘AioHandler *’ 415 | __u64 user_data) | ~~~~~~^~~~~~~~~ cc1: all warnings being treated as errors Use LIBURING_HAVE_DATA64 to check whether the io_uring supports 64-bit variants of the get/set userdata, to convert the paramter to the right data type. Signed-off-by: Haiyue Wang <haiyue.wang@intel.com> Message-Id: <20220221162401.45415-1-haiyue.wang@intel.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'util/fdmon-io_uring.c')
-rw-r--r--util/fdmon-io_uring.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/util/fdmon-io_uring.c b/util/fdmon-io_uring.c
index 1461dfa407..ab43052dd7 100644
--- a/util/fdmon-io_uring.c
+++ b/util/fdmon-io_uring.c
@@ -179,7 +179,11 @@ static void add_poll_remove_sqe(AioContext *ctx, AioHandler *node)
{
struct io_uring_sqe *sqe = get_sqe(ctx);
+#ifdef LIBURING_HAVE_DATA64
+ io_uring_prep_poll_remove(sqe, (__u64)(uintptr_t)node);
+#else
io_uring_prep_poll_remove(sqe, node);
+#endif
}
/* Add a timeout that self-cancels when another cqe becomes ready */