qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] aio-posix: fix build failure io_uring 2.2
@ 2022-02-17 16:16 Haiyue Wang
  2022-02-21 14:54 ` Stefan Hajnoczi
  2022-02-21 16:24 ` [PATCH v2] " Haiyue Wang
  0 siblings, 2 replies; 9+ messages in thread
From: Haiyue Wang @ 2022-02-17 16:16 UTC (permalink / raw)
  To: qemu-devel
  Cc: Haiyue Wang, Fam Zheng, open list:Block I/O path, Stefan Hajnoczi

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

So convert the paramter to right type according to the io_uring define.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
---
 util/fdmon-io_uring.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/util/fdmon-io_uring.c b/util/fdmon-io_uring.c
index 1461dfa407..e7febbf11f 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)node);
+#else
     io_uring_prep_poll_remove(sqe, node);
+#endif
 }
 
 /* Add a timeout that self-cancels when another cqe becomes ready */
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-02-22  9:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-17 16:16 [PATCH v1] aio-posix: fix build failure io_uring 2.2 Haiyue Wang
2022-02-21 14:54 ` Stefan Hajnoczi
2022-02-21 15:54   ` Peter Maydell
2022-02-21 16:59     ` Wang, Haiyue
2022-02-22  8:46     ` Stefan Hajnoczi
2022-02-21 16:43   ` Wang, Haiyue
2022-02-22  8:46     ` Stefan Hajnoczi
2022-02-21 16:24 ` [PATCH v2] " Haiyue Wang
2022-02-22  9:02   ` Stefan Hajnoczi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).