diff --git a/fix-compilation-errors-of-aio-posix-io_uring.patch b/fix-compilation-errors-of-aio-posix-io_uring.patch new file mode 100644 index 0000000000000000000000000000000000000000..d3610c84e6367cac66a5d773e796fb9fb626e0c6 --- /dev/null +++ b/fix-compilation-errors-of-aio-posix-io_uring.patch @@ -0,0 +1,56 @@ +From 8a947c7a586e16a048894e1a0a73d154435e90ef Mon Sep 17 00:00:00 2001 +From: Haiyue Wang +Date: Tue, 22 Feb 2022 00:24:01 +0800 +Subject: [PATCH] aio-posix: fix build failure io_uring 2.2 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +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 +Message-Id: <20220221162401.45415-1-haiyue.wang@intel.com> +Signed-off-by: Stefan Hajnoczi +--- + 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 1461dfa4074..ab43052dd7a 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 */ +-- +GitLab + diff --git a/qemu.spec b/qemu.spec index 1246a96808c35d8e640cb8ec847d357a4d3279d5..6789fc9ffef201832feefa17e0653b1cdf306c81 100644 --- a/qemu.spec +++ b/qemu.spec @@ -3,7 +3,7 @@ Name: qemu Version: 6.2.0 -Release: 77 +Release: 78 Epoch: 10 Summary: QEMU is a generic and open source machine emulator and virtualizer License: GPLv2 and BSD and MIT and CC-BY-SA-4.0 @@ -531,6 +531,7 @@ Patch0516: ide-Increment-BB-in-flight-counter-for-TRIM-BH.patch Patch0517: qga-win32-Remove-change-action-from-MSI-installer.patch Patch0518: qga-win32-Use-rundll-for-VSS-installation.patch Patch0519: test-vmstate-fix-bad-GTree-usage-use-after-free.patch +Patch0520: fix-compilation-errors-of-aio-posix-io_uring.patch BuildRequires: flex BuildRequires: gcc @@ -1104,6 +1105,9 @@ getent passwd qemu >/dev/null || \ %endif %changelog +* Tue Feb 22 2022 Haiyue Wang - 10:6.2.0-78 +- fix aio-posix: fix build failure io_uring + * Mon Aug 7 2023 - 10:6.2.0-77 - test-vmstate: fix bad GTree usage, use-after-free