From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:53730) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLB6I-0004VI-H9 for qemu-devel@nongnu.org; Mon, 08 Oct 2012 07:02:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TLB6G-0002d0-V7 for qemu-devel@nongnu.org; Mon, 08 Oct 2012 07:02:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54329) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TLB6G-0002cQ-N5 for qemu-devel@nongnu.org; Mon, 08 Oct 2012 07:02:16 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q98B2FvN032340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 8 Oct 2012 07:02:15 -0400 Date: Mon, 8 Oct 2012 12:02:12 +0100 From: "Daniel P. Berrange" Message-ID: <20121008110212.GG20230@redhat.com> References: <506F72C3.5080304@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <506F72C3.5080304@redhat.com> Subject: Re: [Qemu-devel] RFC: making QMP query-block more useful Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Jeff Cody , QEMU Developers On Fri, Oct 05, 2012 at 05:52:35PM -0600, Eric Blake wrote: > Right now, 'query-block' has no way to filter to a single device, but > conversely, for each device, it shows only the first backing file, > rather than the entire backing chain. Jeff and I were lamenting this > fact on IRC while debugging his block-commit stuff. > > Would it be worth enhancing the QMP to be: > > ## > # @query-block: > # > # Get a list of BlockInfo for various virtual block devices. > # > # @devices: #optional If provided, limit the output to the given > # device names (since 1.3) > # > # @recurse: #optional Provide recursive information on any backing > # chains (since 1.3, default false) > # > # Returns: a list of @BlockInfo describing each virtual block device > # > # Since: 0.14.0 > ## > { 'command': 'query-block', > 'arguments': { '*names': ['str'], 'recurse': 'bool' }, > 'returns': ['BlockInfo'] } > > as well as enhancing BlockDeviceInfo to be self-recursive, by adding > backing_chain as in: > > # @backing_chain: #optional, only present if @backing_file is present > and 'query-block' requested recursion (since 1.3) > > { 'type': 'BlockDeviceInfo', > 'data': { 'file': 'str', 'ro': 'bool', 'drv': 'str', > '*backing_file': 'str', 'backing_file_depth': 'int', > '*backing_chain' : 'BlockDeviceInfo', > 'encrypted': 'bool', 'encryption_key_missing': 'bool', > 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int', > 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int'} } > > Or would such modifications require the creation of a new QMP command, > instead of altering 'query-block'? I think I'd probably go for creating a new command myself. I agree that both the changes you describe would be useful for libvirt needs. > Likewise, can 'qemu-img info' be enhanced to add a recursion flag? Sounds like a good idea. 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 :|