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(-)
Olaf Hering
2012-Feb-09 12:52 UTC
[PATCH 1 of 2] tools/libxl: rename libxl__yajl_gen_alloc
# HG changeset patch # User Olaf Hering <olaf@aepfle.de> # 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(). Signed-off-by: Olaf Hering <olaf@aepfle.de> diff -r 8ba7ae0b070b -r 85fcc1d0f072 tools/libxl/libxl_json.c --- a/tools/libxl/libxl_json.c +++ b/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; diff -r 8ba7ae0b070b -r 85fcc1d0f072 tools/libxl/libxl_json.h --- a/tools/libxl/libxl_json.h +++ b/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); diff -r 8ba7ae0b070b -r 85fcc1d0f072 tools/libxl/libxl_qmp.c --- a/tools/libxl/libxl_qmp.c +++ b/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;
Olaf Hering
2012-Feb-09 12:53 UTC
[PATCH 2 of 2] tools/libxl: use libxl wrapper for yajl_gen_alloc
# HG changeset patch # User Olaf Hering <olaf@aepfle.de> # 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 <olaf@aepfle.de> 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;
Ian Campbell
2012-Feb-09 13:05 UTC
Re: [PATCH 1 of 2] tools/libxl: rename libxl__yajl_gen_alloc
On Thu, 2012-02-09 at 12:52 +0000, Olaf Hering wrote:> # HG changeset patch > # User Olaf Hering <olaf@aepfle.de> > # 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. Acked-by: Ian Campbell <ian.campbell@citrix.com>> > Signed-off-by: Olaf Hering <olaf@aepfle.de> > > diff -r 8ba7ae0b070b -r 85fcc1d0f072 tools/libxl/libxl_json.c > --- a/tools/libxl/libxl_json.c > +++ b/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; > > diff -r 8ba7ae0b070b -r 85fcc1d0f072 tools/libxl/libxl_json.h > --- a/tools/libxl/libxl_json.h > +++ b/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); > diff -r 8ba7ae0b070b -r 85fcc1d0f072 tools/libxl/libxl_qmp.c > --- a/tools/libxl/libxl_qmp.c > +++ b/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; > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel
Ian Jackson
2012-Feb-29 14:33 UTC
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"):> On Thu, 2012-02-09 at 12:52 +0000, Olaf Hering wrote: > > 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. > > Acked-by: Ian Campbell <ian.campbell@citrix.com>Thanks, applied both (with fixed message for 1/2). Ian.