[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] libxl: use libxl wrapper for yajl_gen_alloc



# HG changeset patch
# User Olaf Hering <olaf@xxxxxxxxx>
# Date 1330525971 0
# Node ID 606af3fbd6fc54e16a286ccfc296f21c523b5d15
# Parent  2b5cf6bde62d4c5278471511cee716650a8eed5a
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 <olaf@xxxxxxxxx>
Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r 2b5cf6bde62d -r 606af3fbd6fc tools/libxl/Makefile
--- a/tools/libxl/Makefile      Wed Feb 29 14:31:59 2012 +0000
+++ b/tools/libxl/Makefile      Wed Feb 29 14:32:51 2012 +0000
@@ -139,7 +139,7 @@
        $(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 2b5cf6bde62d -r 606af3fbd6fc tools/libxl/xl_cmdimpl.c
--- a/tools/libxl/xl_cmdimpl.c  Wed Feb 29 14:31:59 2012 +0000
+++ b/tools/libxl/xl_cmdimpl.c  Wed Feb 29 14:32:51 2012 +0000
@@ -297,13 +297,12 @@
     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;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.