From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sui7T-00050P-EN for qemu-devel@nongnu.org; Fri, 27 Jul 2012 06:50:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sui7L-0004bY-PW for qemu-devel@nongnu.org; Fri, 27 Jul 2012 06:50:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38940) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sui7L-0004bN-HH for qemu-devel@nongnu.org; Fri, 27 Jul 2012 06:49:59 -0400 Message-ID: <50127251.9060203@redhat.com> Date: Fri, 27 Jul 2012 12:49:53 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1343384448-21828-1-git-send-email-xiawenc@linux.vnet.ibm.com> <20120727103352.GR2225@redhat.com> In-Reply-To: <20120727103352.GR2225@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: "Daniel P. Berrange" Cc: aliguori@us.ibm.com, Wenchao Xia , stefanha@linux.vnet.ibm.com, qemu-devel@nongnu.org Il 27/07/2012 12:33, Daniel P. Berrange ha scritto: > #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. I wonder if we could add this also to the QEMU monitor ("info block-image foo"), so that the code would be shared between qemu-img.c and QEMU. Paolo