From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1ZIT-0003Uz-7B for qemu-devel@nongnu.org; Wed, 15 Aug 2012 04:49:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1ZIS-00017h-64 for qemu-devel@nongnu.org; Wed, 15 Aug 2012 04:49:49 -0400 Received: from paradis.irqsave.net ([109.190.18.76]:34758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1ZIR-00017b-U2 for qemu-devel@nongnu.org; Wed, 15 Aug 2012 04:49:48 -0400 Date: Wed, 15 Aug 2012 10:49:43 +0200 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20120815084943.GA2194@irqsave.net> References: <1343384448-21828-1-git-send-email-xiawenc@linux.vnet.ibm.com> <87txwte2j0.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <87txwte2j0.fsf@codemonkey.ws> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] let qemu-img info genereate json output List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: pbonzini@redhat.com, Wenchao Xia , stefanha@linux.vnet.ibm.com, qemu-devel@nongnu.org Le Friday 27 Jul 2012 =E0 08:50:43 (-0500), Anthony Liguori a =E9crit : > Wenchao Xia writes: >=20 > > This patch would add option -j in qemu-img info command, which > > would generate json output in stdout. >=20 > This is a great idea. >=20 > > > > Signed-off-by: Wenchao Xia > > --- > > qemu-img.c | 306 ++++++++++++++++++++++++++++++++++++++++++++++++++= +-------- > > 1 files changed, 264 insertions(+), 42 deletions(-) > > > > diff --git a/qemu-img.c b/qemu-img.c > > index 80cfb9b..a514c17 100644 > > --- a/qemu-img.c > > +++ b/qemu-img.c > > @@ -33,6 +33,9 @@ > > #include > > #endif > > =20 > > +#include "qint.h" > > +#include "qjson.h" > > + > > typedef struct img_cmd_t { > > const char *name; > > int (*handler)(int argc, char **argv); > > @@ -84,6 +87,7 @@ static void help(void) > > " '-p' show progress of command (only certain commands)\= n" > > " '-S' indicates the consecutive number of bytes that mu= st contain only zeros\n" > > " for qemu-img to create a sparse image during conv= ersion\n" > > + " '-j' try get json output, which would be in stdout, > > only valid in info command\n" >=20 > I think an --format=3Djson option would be a bit more extensible and > better matches what most tools are doing these days. The qemu-img info subcommand already use the "-f" short option. What alternative could be use instead of --format=3Djson ? Beno=EEt