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

[Xen-changelog] [xen master] libxl: beautify json with YAJL2



commit c1f0b214536773630cd5f16bf3d275015373555b
Author:     M A Young <m.a.young@xxxxxxxxxxxx>
AuthorDate: Fri Apr 12 00:02:11 2013 +0100
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Fri Apr 12 12:21:02 2013 +0100

    libxl: beautify json with YAJL2
    
    xl list -l should produce readable output when built with yajl2 so
    it is compatible with the xendomains script.
    
    Signed-off-by: Michael Young <m.a.young@xxxxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/libxl/libxl_json.h |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tools/libxl/libxl_json.h b/tools/libxl/libxl_json.h
index 1464459..a4dd8fc 100644
--- a/tools/libxl/libxl_json.h
+++ b/tools/libxl/libxl_json.h
@@ -54,7 +54,11 @@ static inline yajl_handle libxl__yajl_alloc(const 
yajl_callbacks *callbacks,
 
 static inline yajl_gen libxl_yajl_gen_alloc(const yajl_alloc_funcs *allocFuncs)
 {
-    return yajl_gen_alloc(allocFuncs);
+    yajl_gen g;
+    g = yajl_gen_alloc(allocFuncs);
+    if (g)
+        yajl_gen_config(g, yajl_gen_beautify, 1);
+    return g;
 }
 
 #else /* !HAVE_YAJL_V2 */
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
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®.