Skip to contentSkip to conversation

rename libxl__yajl_gen_alloc

PATCH New Olaf Hering 3 participants 5 messages Feb 9, 2012 – Feb 29, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rename libxl__yajl_gen_alloc

Changes:
tools/libxl: rename libxl__yajl_gen_alloc
tools/libxl: use libxl wrapper for yajl_gen_alloc

 tools/libxl/Makefile     |    2 +-
 tools/libxl/libxl_json.c |    2 +-
 tools/libxl/libxl_json.h |    4 ++--
 tools/libxl/libxl_qmp.c  |    2 +-
 tools/libxl/xl_cmdimpl.c |    5 ++---
 5 files changed, 7 insertions(+), 8 deletions(-)
#1 lore raw

PATCH 1/1 tools/libxl: rename libxl__yajl_gen_alloc

# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1328791447 -3600
# Node ID 85fcc1d0f072c4f9d1e8f13b8bb2634228a16f6c # Parent 8ba7ae0b070b4de93fc033067c61714c202d64c1 tools/libxl: rename libxl__yajl_gen_alloc

libxl__yajl_gen_alloc() is called by generic code, rename it to libx__yajl_gen_alloc().

tools/libxl/libxl_json.c +1 -1
diff -r 8ba7ae0b070b -r 85fcc1d0f072 tools/libxl/libxl_json.c
@@ -813,7 +813,7 @@ char *libxl__object_to_json(libxl_ctx *c
     yajl_gen_status s;
     yajl_gen hand;
 
-    hand = libxl__yajl_gen_alloc(NULL);
+    hand = libxl_yajl_gen_alloc(NULL);
     if (!hand)
         return NULL;
 
tools/libxl/libxl_json.h +2 -2
diff -r 8ba7ae0b070b -r 85fcc1d0f072 tools/libxl/libxl_json.h
@@ -40,7 +40,7 @@ static inline yajl_handle libxl__yajl_al
     return yajl_alloc(callbacks, allocFuncs, ctx);
 }
 
-static inline yajl_gen libxl__yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
+static inline yajl_gen libxl_yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
 {
     return yajl_gen_alloc(allocFuncs);
 }
@@ -62,7 +62,7 @@ static inline yajl_handle libxl__yajl_al
     return yajl_alloc(callbacks, &cfg, allocFuncs, ctx);
 }
 
-static inline yajl_gen libxl__yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
+static inline yajl_gen libxl_yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
 {
     yajl_gen_config conf = { 1, "    " };
     return yajl_gen_alloc(&conf, allocFuncs);
tools/libxl/libxl_qmp.c +1 -1
diff -r 8ba7ae0b070b -r 85fcc1d0f072 tools/libxl/libxl_qmp.c
@@ -461,7 +461,7 @@ static char *qmp_send_prepare(libxl__gc 
     yajl_gen hand;
     callback_id_pair *elm = NULL;
 
-    hand = libxl__yajl_gen_alloc(NULL);
+    hand = libxl_yajl_gen_alloc(NULL);
 
     if (!hand) {
         return NULL;
Acked-by on v1 1/1
#2 lore raw

Re: [PATCH 1 of 2] tools/libxl: rename libxl__yajl_gen_alloc

Quoted 9 lines · Olaf Hering

# HG changeset patch
# User Olaf Hering <[email protected]>
# Date 1328791447 -3600
# Node ID 85fcc1d0f072c4f9d1e8f13b8bb2634228a16f6c # Parent 8ba7ae0b070b4de93fc033067c61714c202d64c1 tools/libxl: rename libxl__yajl_gen_alloc

libxl__yajl_gen_alloc() is called by generic code, rename it to libx__yajl_gen_alloc().

Other than this typo both patches in this series look good to me, thanks.

Quoted 53 lines

diff -r 8ba7ae0b070b -r 85fcc1d0f072 tools/libxl/libxl_json.c

tools/libxl/libxl_json.c +1 -1
@@ -813,7 +813,7 @@ char *libxl__object_to_json(libxl_ctx *c
     yajl_gen_status s;
     yajl_gen hand;
 
-    hand = libxl__yajl_gen_alloc(NULL);
+    hand = libxl_yajl_gen_alloc(NULL);
     if (!hand)
         return NULL;
 

diff -r 8ba7ae0b070b -r 85fcc1d0f072 tools/libxl/libxl_json.h

tools/libxl/libxl_json.h +2 -2
@@ -40,7 +40,7 @@ static inline yajl_handle libxl__yajl_al
     return yajl_alloc(callbacks, allocFuncs, ctx);
 }
 
-static inline yajl_gen libxl__yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
+static inline yajl_gen libxl_yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
 {
     return yajl_gen_alloc(allocFuncs);
 }
@@ -62,7 +62,7 @@ static inline yajl_handle libxl__yajl_al
     return yajl_alloc(callbacks, &cfg, allocFuncs, ctx);
 }
 
-static inline yajl_gen libxl__yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
+static inline yajl_gen libxl_yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
 {
     yajl_gen_config conf = { 1, "    " };
     return yajl_gen_alloc(&conf, allocFuncs);

diff -r 8ba7ae0b070b -r 85fcc1d0f072 tools/libxl/libxl_qmp.c

tools/libxl/libxl_qmp.c +1 -1
@@ -461,7 +461,7 @@ static char *qmp_send_prepare(libxl__gc 
     yajl_gen hand;
     callback_id_pair *elm = NULL;
 
-    hand = libxl__yajl_gen_alloc(NULL);
+    hand = libxl_yajl_gen_alloc(NULL);
 
     if (!hand) {
         return NULL;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Applied
#3 lore raw

Re: [PATCH 1 of 2] tools/libxl: rename libxl__yajl_gen_alloc

Ian Campbell writes ("Re: [Xen-devel] [PATCH 1 of 2] tools/libxl: rename libxl__yajl_gen_alloc"):

Quoted 8 lines · Olaf Hering
Quoted 2 lines

libxl__yajl_gen_alloc() is called by generic code, rename it to libx__yajl_gen_alloc().

Other than this typo both patches in this series look good to me, thanks.

Thanks, applied both (with fixed message for 1/2).

Ian.

#4 lore raw

PATCH 1/1 tools/libxl: use libxl wrapper for yajl_gen_alloc

In reply to Olaf Hering

# HG changeset patch
# User Olaf Hering <[email protected]>
# 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()

tools/libxl/Makefile +1 -1
diff -r 85fcc1d0f072 -r 14394647c54e 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)
tools/libxl/xl_cmdimpl.c +2 -3
diff -r 85fcc1d0f072 -r 14394647c54e 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;