packages/utils/qemu/patches/0006-util-mmap-alloc-fix-missing-MAP_SYNC.patch
Vladimir Ermakov b8ef617993 qemu: update to 6.1.0, add usb passthrough option
One of big change is that QEMU has switched to Meson build system.
That result in few changes to build scripts to fix python interpreter
usage.
Second change that it's not possible to select binaries to build, so
now we have to build all targets at once (that require --enable-tools).

Options --disable-sheepdog and --disable-vxhs was removed from qemu
6.1.0 and 6.0.0 accordingly.

Signed-off-by: Vladimir Ermakov <vooon341@gmail.com>
2021-09-14 21:28:45 +08:00

48 lines
1.3 KiB
Diff

From e1e0a76305927290d75b4aae56f1ed89d83da741 Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Mon, 30 Mar 2020 12:48:58 +0800
Subject: [PATCH] util/mmap-alloc: fix missing MAP_SYNC
Quote musl-libc commit 9b57db3f958 ("add MAP_SYNC and
MAP_SHARED_VALIDATE from linux v4.15")
> for synchronous page faults, new in linux commit
> 1c9725974074a047f6080eecc62c50a8e840d050 and
> b6fb293f2497a9841d94f6b57bd2bb2cd222da43
> note that only targets that use asm-generic/mman.h have this new
> flag defined, so undef it on other targets (mips*, powerpc*).
Fixes 119906afa5c ("util/mmap-alloc: support MAP_SYNC in
qemu_ram_mmap()")
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
---
util/mmap-alloc.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
--- a/util/mmap-alloc.c
+++ b/util/mmap-alloc.c
@@ -12,9 +12,6 @@
#ifdef CONFIG_LINUX
#include <linux/mman.h>
-#else /* !CONFIG_LINUX */
-#define MAP_SYNC 0x0
-#define MAP_SHARED_VALIDATE 0x0
#endif /* CONFIG_LINUX */
#include "qemu/osdep.h"
@@ -29,6 +26,13 @@
#include <sys/vfs.h>
#endif
+#ifndef MAP_SYNC
+#define MAP_SYNC 0x0
+#endif
+#ifndef MAP_SHARED_VALIDATE
+#define MAP_SHARED_VALIDATE 0x0
+#endif
+
size_t qemu_fd_getpagesize(int fd)
{
#ifdef CONFIG_LINUX