Le Friday 27 Jul 2012 à 08:50:43 (-0500), Anthony Liguori a écrit : > Wenchao Xia <xiaw...@linux.vnet.ibm.com> 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 <xiaw...@linux.vnet.ibm.com> > > --- > > 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