diff --git a/recipes-extended/xen/files/0001-libxl_nocpuid-fix-build-error.patch b/recipes-extended/xen/files/0001-libxl_nocpuid-fix-build-error.patch new file mode 100644 index 00000000..a6d3e096 --- /dev/null +++ b/recipes-extended/xen/files/0001-libxl_nocpuid-fix-build-error.patch @@ -0,0 +1,41 @@ +From 61a061e43c86a78aaddb2efdcefeff29d13812c2 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield +Date: Thu, 20 Nov 2025 20:57:46 -0500 +Subject: [PATCH] libxl_nocpuid: fix build error + +The Yocto build requires an explict include of tye yajl headers to avoid +this compile error: + +e/libnl3 -Wshadow -include poky/build/tmp/work/armv8a-poky-linux/xen-tools/4.21+stable/sources/xen-tools-4.21+stable/tools/libs/light/../../../tools/config.h -c -o libxl_aoutils.o libxl_aoutils.c +| libxl_nocpuid.c:43:1: error: unknown type name 'yajl_gen_status' +| 43 | yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand, +| | ^~~~~~~~~~~~~~~ +| libxl_nocpuid.c:43:50: error: unknown type name 'yajl_gen' +| 43 | yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand, +| | ^~~~~~~~ +| make[6]: *** [poky/build/tmp/work/armv8a-poky-linux/xen-tools/4.21+stable/sources/xen-tools-4.21+stable/tools/libs/light/../../../tools/Rules.mk:178: libxl_nocpuid.o] Error 1 +| make[6]: *** Waiting for unfinished jobs.... + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Bruce Ashfield +--- + tools/libs/light/libxl_nocpuid.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/tools/libs/light/libxl_nocpuid.c b/tools/libs/light/libxl_nocpuid.c +index 0630959e76..00f6ac3233 100644 +--- a/tools/libs/light/libxl_nocpuid.c ++++ b/tools/libs/light/libxl_nocpuid.c +@@ -14,6 +14,8 @@ + + #include "libxl_internal.h" + ++#include ++ + int libxl__cpuid_policy_is_empty(libxl_cpuid_policy_list *pl) + { + return 1; +-- +2.39.2 + diff --git a/recipes-extended/xen/files/0001-tools-libxl-Fix-build-with-NOCPUID-and-json-c.patch b/recipes-extended/xen/files/0001-tools-libxl-Fix-build-with-NOCPUID-and-json-c.patch new file mode 100644 index 00000000..91767406 --- /dev/null +++ b/recipes-extended/xen/files/0001-tools-libxl-Fix-build-with-NOCPUID-and-json-c.patch @@ -0,0 +1,61 @@ +From 9b7072697616ffd19fcefcd3ec48eec481faf4e6 Mon Sep 17 00:00:00 2001 +From: Bruce Ashfield +Date: Thu, 20 Nov 2025 23:22:59 -0500 +Subject: [PATCH] tools/libxl: Fix build with NOCPUID and json-c + +The stub file `tools/libs/light/libxl_nocpuid.c`, used when CPUID +support is disabled via `CONFIG_NOCPUID`, was incomplete. It was +missing a stub implementation for the `json-c` function +`libxl_cpuid_policy_list_gen_jso`. + +When building with both `CONFIG_NOCPUID` and `HAVE_LIBJSONC` (which +is preferred by configure over yajl), auto-generated code in +`_libxl_types.c` would reference `libxl_cpuid_policy_list_gen_jso`, +leading to a linker error due to the undefined reference. + +Additionally, the file was missing a prototype for the `yajl` function +`libxl_cpuid_policy_list_gen_json`, causing a compiler error +(`-Werror=missing-prototypes`) in builds that did manage to select +`yajl`. + +This commit fixes both issues by: +1. Adding the missing function prototype for the `yajl` function. +2. Adding the missing stub implementation for the `json-c` function, + guarded by `HAVE_LIBJSONC`. + +This ensures that xen-tools can be built successfully in all +configurations related to CPUID and JSON library selection. + +Upstream-Status: Inappropriate [oe specific] + +Signed-off-by: Bruce Ashfield +--- + tools/libs/light/libxl_nocpuid.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +Index: xen-tools-4.21+stable/tools/libs/light/libxl_nocpuid.c +=================================================================== +--- xen-tools-4.21+stable.orig/tools/libs/light/libxl_nocpuid.c ++++ xen-tools-4.21+stable/tools/libs/light/libxl_nocpuid.c +@@ -16,6 +16,21 @@ + + #include + ++#include "libxl_json.h" ++ ++#include ++ ++yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand, ++ libxl_cpuid_policy_list *pcpuid); ++ ++#ifdef HAVE_LIBJSONC ++int libxl_cpuid_policy_list_gen_jso(json_object **jso_r, ++ libxl_cpuid_policy_list *pcpuid) ++{ ++ return 0; ++} ++#endif ++ + int libxl__cpuid_policy_is_empty(libxl_cpuid_policy_list *pl) + { + return 1; diff --git a/recipes-extended/xen/xen-tools.inc b/recipes-extended/xen/xen-tools.inc index a034bc4c..93fcae0b 100644 --- a/recipes-extended/xen/xen-tools.inc +++ b/recipes-extended/xen/xen-tools.inc @@ -24,6 +24,7 @@ RDEPENDS:${PN} = "\ bash perl xz \ ${PN}-console \ ${PN}-libxenguest \ + ${PN}-libxenmanage \ ${PN}-libxenlight \ ${PN}-libxenvchan \ ${PN}-libxenctrl \ @@ -176,6 +177,8 @@ PACKAGES = " \ ${PN}-libxengnttab-dev \ ${PN}-libxenguest \ ${PN}-libxenguest-dev \ + ${PN}-libxenmanage \ + ${PN}-libxenmanage-dev \ ${PN}-libxenhypfs \ ${PN}-libxenhypfs-dev \ ${PN}-libxenlight \ @@ -274,6 +277,7 @@ FILES:${PN}-doc = "\ FILES:${PN}-staticdev += "\ ${libdir}/libxenguest.a \ + ${libdir}/libxenmanage.a \ ${libdir}/libxenlight.a \ ${libdir}/libxenvchan.a \ ${libdir}/libxenctrl.a \ @@ -324,6 +328,13 @@ FILES:${PN}-libxengnttab-dev = " \ ${datadir}/pkgconfig/xengnttab.pc \ " +FILES:${PN}-libxenmanage = "${libdir}/libxenmanage.so.*" +FILES:${PN}-libxenmanage-dev = " \ + ${libdir}/libxenmanage.so \ + ${libdir}/pkgconfig/xenmanage.pc \ + ${datadir}/pkgconfig/xenmanage.pc \ + " + FILES:${PN}-libxenguest = "${libdir}/libxenguest.so.*" FILES:${PN}-libxenguest-dev = " \ ${libdir}/libxenguest.so \ @@ -631,6 +642,7 @@ FILES:${PN}-xen-watchdog = "\ ${sbindir}/xenwatchdogd \ ${sysconfdir}/init.d/xen-watchdog \ ${systemd_unitdir}/system/xen-watchdog.service \ + ${systemd_unitdir}/system-sleep/xen-watchdog-sleep.sh \ " FILES:${PN}-xl = "\ @@ -715,6 +727,14 @@ FILES:${PN}-test += "\ ${libdir}/xen/bin/test-cpu-policy \ ${libdir}/xen/bin/test-tsx \ ${libdir}/xen/bin/test-paging-mempool \ + ${libdir}/xen/tests/test-xenstore \ + ${libdir}/xen/tests/test-rangeset \ + ${libdir}/xen/tests/test-resource \ + ${libdir}/xen/tests/test-domid \ + ${libdir}/xen/tests/test-paging-mempool \ + ${libdir}/xen/tests/test_vpci \ + ${libdir}/xen/tests/test-pdx-offset \ + ${libdir}/xen/tests/test-pdx-mask \ " # test-xenstore and test-resource currently only exist in 4.16 diff --git a/recipes-extended/xen/xen-tools_4.21.bb b/recipes-extended/xen/xen-tools_4.21.bb new file mode 100644 index 00000000..7f134280 --- /dev/null +++ b/recipes-extended/xen/xen-tools_4.21.bb @@ -0,0 +1,20 @@ +SRCREV ?= "06af9ef22996cecc2024a2e6523cec77a655581e" + +XEN_REL ?= "4.21" +XEN_BRANCH ?= "stable-4.21" + +SRC_URI = " \ + git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \ + file://0001-python-pygrub-pass-DISTUTILS-xen-4.19.patch \ + file://0001-libxl_nocpuid-fix-build-error.patch \ + file://0001-tools-libxl-Fix-build-with-NOCPUID-and-json-c.patch \ + " + +LIC_FILES_CHKSUM ?= "file://COPYING;md5=d1a1e216f80b6d8da95fec897d0dbec9" + +PV = "${XEN_REL}+stable" + +DEFAULT_PREFERENCE ??= "-1" + +require xen.inc +require xen-tools.inc diff --git a/recipes-extended/xen/xen_4.21.bb b/recipes-extended/xen/xen_4.21.bb new file mode 100644 index 00000000..d8db7281 --- /dev/null +++ b/recipes-extended/xen/xen_4.21.bb @@ -0,0 +1,19 @@ +SRCREV ?= "06af9ef22996cecc2024a2e6523cec77a655581e" + +XEN_REL ?= "4.21.0" +XEN_BRANCH ?= "stable-4.21" + +SRC_URI = " \ + git://xenbits.xen.org/xen.git;branch=${XEN_BRANCH} \ + file://0001-menuconfig-mconf-cfg-Allow-specification-of-ncurses-location.patch \ + file://0001-libxl_nocpuid-fix-build-error.patch \ + " + +LIC_FILES_CHKSUM ?= "file://COPYING;md5=d1a1e216f80b6d8da95fec897d0dbec9" + +PV = "${XEN_REL}+stable" + +DEFAULT_PREFERENCE ??= "-1" + +require xen.inc +require xen-hypervisor.inc