diff options
Diffstat (limited to 'meta')
3 files changed, 51 insertions, 58 deletions
diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc index bc1440249d..0cced6ed32 100644 --- a/meta/recipes-devtools/qemu/qemu.inc +++ b/meta/recipes-devtools/qemu/qemu.inc | |||
@@ -32,7 +32,7 @@ SRC_URI = "https://download.qemu.org/${BPN}-${PV}.tar.xz \ | |||
32 | file://0010-hw-pvrdma-Protect-against-buggy-or-malicious-guest-d.patch \ | 32 | file://0010-hw-pvrdma-Protect-against-buggy-or-malicious-guest-d.patch \ |
33 | file://0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch \ | 33 | file://0002-linux-user-Replace-use-of-lfs64-related-functions-an.patch \ |
34 | file://fixedmeson.patch \ | 34 | file://fixedmeson.patch \ |
35 | file://0001-vfio-Include-libgen.h-for-basename-API.patch \ | 35 | file://0001-vfio-container-Replace-basename-with-g_path_get_base.patch \ |
36 | file://no-pip.patch \ | 36 | file://no-pip.patch \ |
37 | file://fix_segv.patch \ | 37 | file://fix_segv.patch \ |
38 | file://qemu-guest-agent.init \ | 38 | file://qemu-guest-agent.init \ |
diff --git a/meta/recipes-devtools/qemu/qemu/0001-vfio-Include-libgen.h-for-basename-API.patch b/meta/recipes-devtools/qemu/qemu/0001-vfio-Include-libgen.h-for-basename-API.patch deleted file mode 100644 index 5b8b638736..0000000000 --- a/meta/recipes-devtools/qemu/qemu/0001-vfio-Include-libgen.h-for-basename-API.patch +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | From e31c67ef65a4217f35f6cd40926251054094dff9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Mon, 11 Dec 2023 16:44:16 -0800 | ||
4 | Subject: [PATCH v2] vfio: Include libgen.h for basename API | ||
5 | |||
6 | Glibc has two implementation one based on POSIX which is used when | ||
7 | libgen.h is included and second implementation is GNU implementation | ||
8 | which is used when string.h is included. The functions are no identical | ||
9 | in behavior. Musl C library does not implement the GNU version, but it | ||
10 | has provided a declaration in string.h but this has been corrected in | ||
11 | latest musl [1] which exposes places where it was being used from | ||
12 | string.h to error out especially when -Wimplicit-function-declaration is | ||
13 | treated as error. | ||
14 | |||
15 | | ../qemu-8.1.2/hw/vfio/pci.c:3030:18: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] | ||
16 | | 3030 | group_name = basename(group_path); | ||
17 | |||
18 | clang-17 treats this warning as error by default | ||
19 | |||
20 | [1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 | ||
21 | |||
22 | Upstream-Status: Submitted [https://lists.nongnu.org/archive/html/qemu-devel/2023-12/msg01438.html] | ||
23 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
24 | --- | ||
25 | v2: Add missing link for [1] | ||
26 | |||
27 | hw/vfio/pci.c | 1 + | ||
28 | hw/vfio/platform.c | 1 + | ||
29 | 2 files changed, 2 insertions(+) | ||
30 | |||
31 | diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c | ||
32 | index c62c02f7b6..f043c93b9e 100644 | ||
33 | --- a/hw/vfio/pci.c | ||
34 | +++ b/hw/vfio/pci.c | ||
35 | @@ -19,6 +19,7 @@ | ||
36 | */ | ||
37 | |||
38 | #include "qemu/osdep.h" | ||
39 | +#include <libgen.h> | ||
40 | #include <linux/vfio.h> | ||
41 | #include <sys/ioctl.h> | ||
42 | |||
43 | diff --git a/hw/vfio/platform.c b/hw/vfio/platform.c | ||
44 | index 8e3d4ac458..a835ab03be 100644 | ||
45 | --- a/hw/vfio/platform.c | ||
46 | +++ b/hw/vfio/platform.c | ||
47 | @@ -16,6 +16,7 @@ | ||
48 | |||
49 | #include "qemu/osdep.h" | ||
50 | #include "qapi/error.h" | ||
51 | +#include <libgen.h> | ||
52 | #include <sys/ioctl.h> | ||
53 | #include <linux/vfio.h> | ||
54 | |||
55 | -- | ||
56 | 2.43.0 | ||
57 | |||
diff --git a/meta/recipes-devtools/qemu/qemu/0001-vfio-container-Replace-basename-with-g_path_get_base.patch b/meta/recipes-devtools/qemu/qemu/0001-vfio-container-Replace-basename-with-g_path_get_base.patch new file mode 100644 index 0000000000..ad4f410178 --- /dev/null +++ b/meta/recipes-devtools/qemu/qemu/0001-vfio-container-Replace-basename-with-g_path_get_base.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From 213ae3ffda463c0503e39e0cf827511b5298c314 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= <clg@redhat.com> | ||
3 | Date: Wed, 20 Dec 2023 14:53:02 +0100 | ||
4 | Subject: [PATCH] vfio/container: Replace basename with g_path_get_basename | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | g_path_get_basename() is a portable utility function that has the | ||
10 | advantage of not modifing the string argument. It also fixes a compile | ||
11 | breakage with the Musl C library reported in [1]. | ||
12 | |||
13 | [1] https://lore.kernel.org/all/20231212010228.2701544-1-raj.khem@gmail.com/ | ||
14 | |||
15 | Upstream-Status: Backport [https://github.com/qemu/qemu/commit/213ae3ffda463c0503e39e0cf827511b5298c314] | ||
16 | Reported-by: Khem Raj <raj.khem@gmail.com> | ||
17 | Reviewed-by: Eric Auger <eric.auger@redhat.com> | ||
18 | Reviewed-by: Zhao Liu <zhao1.liu@intel.com> | ||
19 | Reviewed-by: Zhenzhong Duan <zhenzhong.duan@intel.com> | ||
20 | Signed-off-by: Cédric Le Goater <clg@redhat.com> | ||
21 | --- | ||
22 | hw/vfio/container.c | 5 +++-- | ||
23 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
24 | |||
25 | diff --git a/hw/vfio/container.c b/hw/vfio/container.c | ||
26 | index 688cf23bab..8d334f52f2 100644 | ||
27 | --- a/hw/vfio/container.c | ||
28 | +++ b/hw/vfio/container.c | ||
29 | @@ -869,7 +869,8 @@ static void vfio_put_base_device(VFIODevice *vbasedev) | ||
30 | |||
31 | static int vfio_device_groupid(VFIODevice *vbasedev, Error **errp) | ||
32 | { | ||
33 | - char *tmp, group_path[PATH_MAX], *group_name; | ||
34 | + char *tmp, group_path[PATH_MAX]; | ||
35 | + g_autofree char *group_name = NULL; | ||
36 | int ret, groupid; | ||
37 | ssize_t len; | ||
38 | |||
39 | @@ -885,7 +886,7 @@ static int vfio_device_groupid(VFIODevice *vbasedev, Error **errp) | ||
40 | |||
41 | group_path[len] = 0; | ||
42 | |||
43 | - group_name = basename(group_path); | ||
44 | + group_name = g_path_get_basename(group_path); | ||
45 | if (sscanf(group_name, "%d", &groupid) != 1) { | ||
46 | error_setg_errno(errp, errno, "failed to read %s", group_path); | ||
47 | return -errno; | ||
48 | -- | ||
49 | 2.43.0 | ||
50 | |||