qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH RFC] qapi: Allow getting flat output from 'query-named-block-


From: Peter Krempa
Subject: Re: [PATCH RFC] qapi: Allow getting flat output from 'query-named-block-nodes'
Date: Thu, 19 Dec 2019 09:54:15 +0100
User-agent: Mutt/1.12.1 (2019-06-15)

On Tue, Dec 17, 2019 at 16:11:37 +0100, Markus Armbruster wrote:
> Eric Blake <address@hidden> writes:
> 
> > On 12/17/19 1:36 AM, Markus Armbruster wrote:
> >
> >> Un-snipping the QAPI schema change:
> >
> > Sorry about that...
> >
> >>
> >>>> diff --git a/qapi/block-core.json b/qapi/block-core.json
> >>>> index 0cf68fea14..bd651106bd 100644
> >>>> --- a/qapi/block-core.json
> >>>> +++ b/qapi/block-core.json
> >>>> @@ -1752,6 +1752,8 @@
> >>>>   #
> >>>>   # Get the named block driver list
> >>>>   #
> >>>> +# @flat: don't recurse into backing images if true. Default is false 
> >>>> (Since 5.0)
> >>>> +#
> >>>>   # Returns: the list of BlockDeviceInfo
> >>>>   #
> >>>>   # Since: 2.0
> >>
> >> What does it mean not to recurse?  Sounds like flat: false asks for a
> >> subset of the full set.  How exactly is the subset defined?
> >
> > Bike-shedding:
> >
> > Would it be easier to explain as:
> >
> > @recurse: If true, include child information in each node (note that
> > this can result in redundant output). Default is true (since 5.0)
> >
> > and then pass false when you don't want recursion, with it being more
> > obvious that using the new flag results in more compact output with no
> > loss of information.
> 
> Adds a bit of information, namely that the information suppressed by
> recurse: false is actually redundant.
> 
> The command's doc comment is weak: it doesn't really specify what
> exactly is returned.  Simply omitting redundant information always
> should still conform to this weak spec.  Of course, what really counts
> isn't spec conformance, but meeting client expectations.  I don't even
> understand what exactly gets returned, let alone how clients use it.

Well I by default expect that if the top level array has data for all
node names the nesting which repeats the information (partially) should
not be there because you can just look elsewhere for a more detailed
output.

Said that two years ago I wrote some code which detects the node names
from running qemu because at that time it was the only way to use the
block write threshold event. This code needs to extract the nesting
topology somehow but I don't remember nor fancy re-understanding the
algorithm for the detection during the hollidays. The only thing I can
say that the nesting is extracted either from the output of query-block
or from query-named-block nodes as both these outputs are fed to that
algorithm.

With blockdev that piece of code thankfully is unused, but unfortunately
I can't say that the nested output of query-named-block-nodes doesn't
have it's use.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]