[PATCH] tools/libxl: Fix libxl_nocpuid.c build with json-c

Andrew Cooper posted 1 patch 3 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20260508162815.1617203-1-andrew.cooper3@citrix.com
tools/libs/light/libxl_nocpuid.c | 10 ++++++++++
1 file changed, 10 insertions(+)
[PATCH] tools/libxl: Fix libxl_nocpuid.c build with json-c
Posted by Andrew Cooper 3 weeks ago
libxl_nocpuid.c needs the same treatment as libxl_cpuid.c

Fixes: f6c6f2679d49 ("libxl: Convert libxl__object_to_json() to json-c")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Anthony PERARD <anthony.perard@vates.tech>
CC: Juergen Gross <jgross@suse.com>
CC: Michael Young <m.a.young@durham.ac.uk>
CC: Stefano Stabellini <sstabellini@kernel.org>

Discovered while trying to complete the ARM CI cleanup.

This supercedes
https://lore.kernel.org/xen-devel/94ffdeb1-6826-4c3a-a9c1-3ccc8b129a61@durham.ac.uk/T/#u
using Anthony's suggested approach.

Failed run:
  https://gitlab.com/xen-project/hardware/xen-staging/-/jobs/14282279751

Succeeding run (same container):
  https://gitlab.com/xen-project/hardware/xen-staging/-/jobs/14282714527
---
 tools/libs/light/libxl_nocpuid.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/libs/light/libxl_nocpuid.c b/tools/libs/light/libxl_nocpuid.c
index 0630959e760c..ce334633b376 100644
--- a/tools/libs/light/libxl_nocpuid.c
+++ b/tools/libs/light/libxl_nocpuid.c
@@ -40,11 +40,21 @@ int libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t domid, bool restore,
     return 0;
 }
 
+#ifdef HAVE_LIBJSONC
+int libxl_cpuid_policy_list_gen_jso(json_object **jso_r, libxl_cpuid_policy_list *pl)
+{
+    *jso_r = NULL;
+    return 0;
+}
+#endif
+
+#ifdef HAVE_LIBYAJL
 yajl_gen_status libxl_cpuid_policy_list_gen_json(yajl_gen hand,
                                 libxl_cpuid_policy_list *pcpuid)
 {
     return 0;
 }
+#endif
 
 int libxl__cpuid_policy_list_parse_json(libxl__gc *gc,
                                         const libxl__json_object *o,
-- 
2.39.5
Re: [PATCH] tools/libxl: Fix libxl_nocpuid.c build with json-c
Posted by Anthony PERARD 2 weeks, 3 days ago
On Fri, May 08, 2026 at 05:28:15PM +0100, Andrew Cooper wrote:
> libxl_nocpuid.c needs the same treatment as libxl_cpuid.c
> 
> Fixes: f6c6f2679d49 ("libxl: Convert libxl__object_to_json() to json-c")
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> 
> Discovered while trying to complete the ARM CI cleanup.
> 
> This supercedes
> https://lore.kernel.org/xen-devel/94ffdeb1-6826-4c3a-a9c1-3ccc8b129a61@durham.ac.uk/T/#u
> using Anthony's suggested approach.
> 
> Failed run:
>   https://gitlab.com/xen-project/hardware/xen-staging/-/jobs/14282279751
> 
> Succeeding run (same container):
>   https://gitlab.com/xen-project/hardware/xen-staging/-/jobs/14282714527

Reviewed-by: Anthony PERARD <anthony.perard@vates.tech>

Thanks,


-- 
Anthony Perard | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech