All of lore.kernel.org
 help / color / mirror / Atom feed
* [XEN PATCH] libxl_nocpuid.c: fix build with json-c
@ 2025-11-21 21:09 Michael Young
  2025-11-24  9:26 ` Jan Beulich
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Young @ 2025-11-21 21:09 UTC (permalink / raw)
  To: xen-devel; +Cc: Anthony PERARD, Juergen Gross

[-- Attachment #1: Type: text/plain, Size: 1682 bytes --]

The build of xen-4.21.0 with json-c present and yajl not present
is failing with the error

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]: *** 
[/builddir/build/BUILD/xen-4.21.0-build/xen-4.21.0/tools/libs/light/../../../tools/Rules.mk:178: libxl_nocpuid.o] Error 1

I tested it with the patch below based on libxl_nocpuid.c which did build.

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
---
  tools/libs/light/libxl_nocpuid.c | 13 +++++++++++++
  1 file changed, 13 insertions(+)

diff --git a/tools/libs/light/libxl_nocpuid.c 
b/tools/libs/light/libxl_nocpuid.c
index 0630959e76..71ab49ed61 100644
--- a/tools/libs/light/libxl_nocpuid.c
+++ b/tools/libs/light/libxl_nocpuid.c
@@ -40,11 +40,24 @@ int libxl__cpuid_legacy(libxl_ctx *ctx, uint32_t 
domid, bool restore,
      return 0;
  }

+#ifdef HAVE_LIBJSONC
+#ifndef _hidden
+#define _hidden
+#endif
+_hidden int libxl_cpuid_policy_list_gen_jso(json_object **jso_r,
+                                libxl_cpuid_policy_list *pcpuid)
+{
+    return 0;
+}
+#endif
+
+#if defined(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.51.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-11-27 11:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-21 21:09 [XEN PATCH] libxl_nocpuid.c: fix build with json-c Michael Young
2025-11-24  9:26 ` Jan Beulich
2025-11-27 11:05   ` Anthony PERARD

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.