[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] let qemu-img info genereate json output
From: |
Benoît Canet |
Subject: |
Re: [Qemu-devel] [PATCH] let qemu-img info genereate json output |
Date: |
Wed, 15 Aug 2012 10:49:43 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Le Friday 27 Jul 2012 à 08:50:43 (-0500), Anthony Liguori a écrit :
> Wenchao Xia <address@hidden> writes:
>
> > This patch would add option -j in qemu-img info command, which
> > would generate json output in stdout.
>
> This is a great idea.
>
> >
> > Signed-off-by: Wenchao Xia <address@hidden>
> > ---
> > 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 <windows.h>
> > #endif
> >
> > +#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 must
> > contain only zeros\n"
> > " for qemu-img to create a sparse image during
> > conversion\n"
> > + " '-j' try get json output, which would be in stdout,
> > only valid in info command\n"
>
> I think an --format=json 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=json ?
Benoît
- Re: [Qemu-devel] [PATCH] let qemu-img info genereate json output,
Benoît Canet <=