rename libxl__yajl_gen_alloc
PATCH 1/1 rename libxl__yajl_gen_alloc
Changes:tools/libxl: rename libxl__yajl_gen_alloctools/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(-)
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
@@ -813,7 +813,7 @@ char *libxl__object_to_json(libxl_ctx *cyajl_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
@@ -40,7 +40,7 @@ static inline yajl_handle libxl__yajl_alreturn 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_alreturn 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
@@ -461,7 +461,7 @@ static char *qmp_send_prepare(libxl__gcyajl_gen hand;callback_id_pair *elm =NULL ; - hand =libxl__yajl_gen_alloc (NULL ); + hand =libxl_yajl_gen_alloc (NULL );if (!hand) {return NULL ;
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 ID85fcc1d0f072c4f9d1e8f13b8bb2634228a16f6c# Parent8ba7ae0b070b4de93fc033067c61714c202d64c1tools/libxl: renamelibxl__yajl_gen_alloc
libxl__yajl_gen_alloc()is called by generic code, rename it tolibx__yajl_gen_alloc().
Other than this typo both patches in this series look good to me, thanks.
Quoted 53 lines
Signed-off-by Olaf Hering <[email protected]>diff -r
8ba7ae0b070b-r85fcc1d0f072tools/libxl/libxl_json.ctools/libxl/libxl_json.c +1
-1@@ -813,7 +813,7 @@ char *libxl__object_to_json(libxl_ctx *cyajl_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-r85fcc1d0f072tools/libxl/libxl_json.htools/libxl/libxl_json.h +2
-2@@ -40,7 +40,7 @@ static inline yajl_handle libxl__yajl_alreturn 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_alreturn 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-r85fcc1d0f072tools/libxl/libxl_qmp.ctools/libxl/libxl_qmp.c +1
-1@@ -461,7 +461,7 @@ static char *qmp_send_prepare(libxl__gcyajl_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
Ian Jackson
AppliedRe: [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 tolibx__yajl_gen_alloc().Other than this typo both patches in this series look good to me, thanks.
Acked-by Ian Campbell <[email protected]>
Thanks, applied both (with fixed message for 1/2).
Ian.
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
@@ -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
@@ -297,13 +297,12 @@ static void printf_info(enum output_formif (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 ;