qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] RFC: making QMP query-block more useful
@ 2012-10-05 23:52 Eric Blake
  2012-10-08 11:02 ` Daniel P. Berrange
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Blake @ 2012-10-05 23:52 UTC (permalink / raw)
  To: QEMU Developers, Jeff Cody

[-- Attachment #1: Type: text/plain, Size: 1745 bytes --]

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'?

Likewise, can 'qemu-img info' be enhanced to add a recursion flag?

-- 
Eric Blake   eblake@redhat.com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 617 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] RFC: making QMP query-block more useful
  2012-10-05 23:52 [Qemu-devel] RFC: making QMP query-block more useful Eric Blake
@ 2012-10-08 11:02 ` Daniel P. Berrange
  2012-10-09 13:24   ` Luiz Capitulino
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel P. Berrange @ 2012-10-08 11:02 UTC (permalink / raw)
  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 :|

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] RFC: making QMP query-block more useful
  2012-10-08 11:02 ` Daniel P. Berrange
@ 2012-10-09 13:24   ` Luiz Capitulino
  0 siblings, 0 replies; 3+ messages in thread
From: Luiz Capitulino @ 2012-10-09 13:24 UTC (permalink / raw)
  To: Daniel P. Berrange; +Cc: Jeff Cody, QEMU Developers

On Mon, 8 Oct 2012 12:02:12 +0100
"Daniel P. Berrange" <berrange@redhat.com> wrote:

> 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.

I vote for a new command too.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-10-09 13:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-05 23:52 [Qemu-devel] RFC: making QMP query-block more useful Eric Blake
2012-10-08 11:02 ` Daniel P. Berrange
2012-10-09 13:24   ` Luiz Capitulino

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).