From 9c33ab91c5759d108b7b5096f072819c6bce8e13 Mon Sep 17 00:00:00 2001 From: Olaf Hering Date: Wed, 29 Feb 2012 14:32:51 +0000 Subject: [PATCH] libxl: use libxl wrapper for yajl_gen_alloc To fix compile errors with libyajl2: * use libxl_yajl_gen_alloc() * use libxl_yajl_length * link xl with -lyajl for yajl_gen_string() Signed-off-by: Olaf Hering Acked-by: Ian Campbell Signed-off-by: Ian Jackson Committed-by: Ian Jackson --- tools/libxl/Makefile | 2 +- tools/libxl/xl_cmdimpl.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile index ce38585340..e44fcfaa87 100644 --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -139,7 +139,7 @@ libxlutil.a: $(LIBXLU_OBJS) $(AR) rcs libxlutil.a $^ xl: $(XL_OBJS) libxlutil.so libxenlight.so - $(CC) $(LDFLAGS) -o $@ $(XL_OBJS) libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS) + $(CC) $(LDFLAGS) -o $@ $(XL_OBJS) libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) -lyajl $(APPEND_LDFLAGS) testidl: testidl.o libxlutil.so libxenlight.so $(CC) $(LDFLAGS) -o $@ testidl.o libxlutil.so $(LDLIBS_libxenlight) $(LDLIBS_libxenctrl) $(APPEND_LDFLAGS) diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 1b2e727980..c7475f6101 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -297,13 +297,12 @@ static void printf_info(enum output_format output_format, if (output_format == OUTPUT_FORMAT_SXP) return printf_info_sexp(domid, d_config); - yajl_gen_config conf = { 1, " " }; const char *buf; - unsigned int len = 0; + libxl_yajl_length len = 0; yajl_gen_status s; yajl_gen hand; - hand = yajl_gen_alloc(&conf, NULL); + hand = libxl_yajl_gen_alloc(NULL); if (!hand) { fprintf(stderr, "unable to allocate JSON generator\n"); return; -- 2.30.2