From: Olaf Hering Subject: [PATCH 2 of 2] tools/libxl: use libxl wrapper for yajl_gen_alloc Date: Thu, 09 Feb 2012 13:53:00 +0100 Message-ID: <14394647c54e40d82f4d.1328791980@probook.site> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User Olaf Hering # Date 1328791471 -3600 # Node ID 14394647c54e40d82f4dbce2d6571a3d9b836719 # Parent 85fcc1d0f072c4f9d1e8f13b8bb2634228a16f6c tools/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 diff -r 85fcc1d0f072 -r 14394647c54e tools/libxl/Makefile --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -142,7 +142,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 -r 85fcc1d0f072 -r 14394647c54e tools/libxl/xl_cmdimpl.c --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -297,13 +297,12 @@ static void printf_info(enum output_form 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;