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 via email to