From: Stefan Hajnoczi <stefanha@redhat.com>
To: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>
Cc: Fam Zheng <fam@euphon.net>, Paolo Bonzini <pbonzini@redhat.com>,
Haiyue Wang <haiyue.wang@intel.com>,
qemu-block@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: [PULL for-7.0 1/2] aio-posix: fix build failure io_uring 2.2
Date: Thu, 17 Mar 2022 16:57:42 +0000 [thread overview]
Message-ID: <20220317165743.238662-2-stefanha@redhat.com> (raw)
In-Reply-To: <20220317165743.238662-1-stefanha@redhat.com>
From: Haiyue Wang <haiyue.wang@intel.com>
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>
---
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..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 */
--
2.35.1
next prev parent reply other threads:[~2022-03-17 17:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-17 16:57 [PULL for-7.0 0/2] Block patches Stefan Hajnoczi
2022-03-17 16:57 ` Stefan Hajnoczi [this message]
2022-03-17 17:14 ` [PULL for-7.0 1/2] aio-posix: fix build failure io_uring 2.2 Daniel P. Berrangé
2022-03-18 2:57 ` Wang, Haiyue
2022-03-21 13:41 ` Stefan Hajnoczi
2022-03-17 16:57 ` [PULL for-7.0 2/2] aio-posix: fix spurious ->poll_ready() callbacks in main loop Stefan Hajnoczi
2022-03-17 18:36 ` [PULL for-7.0 0/2] Block patches Peter Maydell
2022-03-21 14:44 ` Stefan Hajnoczi
2022-03-21 17:46 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220317165743.238662-2-stefanha@redhat.com \
--to=stefanha@redhat.com \
--cc=fam@euphon.net \
--cc=haiyue.wang@intel.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).