qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Cc: pbonzini@redhat.com, aliguori@us.ibm.com, qemu-devel@nongnu.org,
	stefanha@linux.vnet.ibm.com
Subject: Re: [Qemu-devel] [PATCH] let qemu-img info genereate json output
Date: Fri, 27 Jul 2012 11:33:52 +0100	[thread overview]
Message-ID: <20120727103352.GR2225@redhat.com> (raw)
In-Reply-To: <1343384448-21828-1-git-send-email-xiawenc@linux.vnet.ibm.com>

On Fri, Jul 27, 2012 at 06:20:48PM +0800, Wenchao Xia wrote:
>   This patch would add option -j in qemu-img info command, which
> would generate json output in stdout.

I like this idea in general, because currently apps (oVirt, OpenStack, etc)
rely on parsing the human format, which is just as evil as libvirt relying
on -help format.

It would be helpful if you actually included the JSON output in your
commit message. For the benefit of other reviews, it generates the
following:

 #qemu-img info -j /var/lib/libvirt/images/bar.qcow2
 {
    "information": {
        "actual_size": "139264",
        "fmt": "qcow2",
        "virtual_size": "10485760",
        "filename": "/var/lib/libvirt/images/bar.qcow2",
        "cluster_size": 65536,
        "encrypted": 0,
        "snapshot_list": [
        ],
        "dirty_flag": 0,
        "backing_filename": "/dev/sda1"
    },
    "return": 0
 }

IIUC,the 'return' element here is just duplicating the qemu-img
exit status. I think this is rather dubious, and would rather
just see the stuff in the 'information' sub-block be output
directly. It also seems to forget to mention the backing
file format.


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

  reply	other threads:[~2012-07-27 10:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-27 10:20 [Qemu-devel] [PATCH] let qemu-img info genereate json output Wenchao Xia
2012-07-27 10:33 ` Daniel P. Berrange [this message]
2012-07-27 10:49   ` Paolo Bonzini
2012-07-27 10:52     ` Daniel P. Berrange
2012-07-27 13:52       ` Anthony Liguori
2012-07-27 13:50 ` Anthony Liguori
2012-08-15  8:49   ` Benoît Canet
2012-08-15 13:17     ` Eric Blake
2012-07-30 14:34 ` Stefan Hajnoczi

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=20120727103352.GR2225@redhat.com \
    --to=berrange@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@linux.vnet.ibm.com \
    --cc=xiawenc@linux.vnet.ibm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).