All of lore.kernel.org
 help / color / mirror / Atom feed
From: M A Young <m.a.young@durham.ac.uk>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Stefano Stabellini <Stefano.Stabellini@eu.citrix.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>
Subject: Re: [PATCH] allow xendomains to work for xl list -l
Date: Thu, 11 Apr 2013 00:15:28 +0100 (BST)	[thread overview]
Message-ID: <alpine.DEB.2.00.1304110010560.2900@procyon.dur.ac.uk> (raw)
In-Reply-To: <1365598851.27868.44.camel@zakaz.uk.xensource.com>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1207 bytes --]

On Wed, 10 Apr 2013, Ian Campbell wrote:

> On Tue, 2013-04-09 at 21:05 +0100, M A Young wrote:
>> From xen 4.2 onwards xl list -l gives a JSON format output containing no
>> spaces or line feeds, but the xendomains script expects the older format
>> (of xl in xen 4.1 and xm) of one key-value pair per line.
>
> Hrm, I'm not sure this change was intentional and I don't recall a patch
> which did this on purpose. Ideally xl list would remain somewhat human
> readable even if it is also machine readable.
>
> I wonder if this is yajl v1 vs v2 specific? For v1 libxl_yajl_gen_alloc
> creates a yajl_gen_config with beautify = 1 and passes it to
> yajl_gen_alloc.
>
> For v2 however yajl_gen_alloc doesn't take such an option. It looks like
> we are instead supposed to call yajl_gen_config with yajl_gen_beautify.
> We probably also want to set yajl_gen_indent_string to "    " (although
> that might be the default from my reading).
>
> I don't have a yajl2 test system handy -- could you try that though?

Yes, setting yajl_gen_beautify (as in the attached patch) gets the 
xendomains script working again. I didn't try setting the spaces though 
that does indeed seem to be the default.

 	Michael Young

[-- Attachment #2: Type: TEXT/PLAIN, Size: 462 bytes --]

--- xen-4.2.2/tools/libxl/libxl_json.h.orig	2013-03-21 17:55:42.000000000 +0000
+++ xen-4.2.2/tools/libxl/libxl_json.h	2013-04-10 22:14:15.938459238 +0100
@@ -54,7 +54,10 @@
 
 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);
+    yajl_gen_config(g, yajl_gen_beautify, 1);
+    return g;
 }
 
 #else /* !HAVE_YAJL_V2 */

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2013-04-10 23:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-09 20:05 [PATCH] allow xendomains to work for xl list -l M A Young
2013-04-10 13:00 ` Ian Campbell
2013-04-10 13:04   ` Ian Campbell
2013-04-10 23:15   ` M A Young [this message]
2013-04-11  7:57     ` Ian Campbell
2013-04-11 23:02       ` M A Young
2013-04-12 11:41         ` Ian Campbell
2013-04-11 12:46     ` [PATCH] allow xendomains to work for xl list -l [and 1 more messages] Ian Jackson
2013-04-11 13:10       ` Ian Campbell
2013-04-11 15:56         ` Ian Jackson
2013-04-11 22:06   ` [PATCH] allow xendomains to work for xl list -l M A Young
2013-04-12  8:03     ` Ian Campbell
2013-04-11 11:38 ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.00.1304110010560.2900@procyon.dur.ac.uk \
    --to=m.a.young@durham.ac.uk \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=Stefano.Stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.