[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC for-2.7 1/1] block/qapi: Add query-block-node-tree
From: |
Max Reitz |
Subject: |
Re: [Qemu-devel] [RFC for-2.7 1/1] block/qapi: Add query-block-node-tree |
Date: |
Sat, 26 Mar 2016 17:27:11 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 |
On 25.03.2016 03:50, Wen Congyang wrote:
> On 03/25/2016 03:07 AM, Max Reitz wrote:
>> This command returns the tree of BlockDriverStates under a given root
>> node.
>>
>> Every tree node is described by its node name and the connection of a
>> parent node to its children additionally contains the role the child
>> assumes.
>>
>> A node's name can then be used e.g. in conjunction with
>> query-named-block-nodes to get more information about the node.
>
> I test this patch, and it works.
> {'execute': 'query-block-node-tree', 'arguments': {'root-node': 'disk1' } }
> {"return": {"children": [{"role": "children.0", "node": {"children":
> [{"role": "file", "node": {"children": [], "node-name": "#block175"}}],
> "node-name": "#block267"}}], "node-name": "#block040"}}
>
> Shoule we hide the node name like "#blockxxx"?
No, I don't think so. In fact I was thinking of making the node name
non-optional because every BDS should have one due to these
auto-generated ones.
> If the bs doesn't have any child, should we output: '"children": [], '?
Omitting an empty array (thus making the @children key optional)
occurred to me, too. I didn't find any strong reason to do so, however.
It makes generating the output a bit more complicated and may also make
parsing it just a tiny bit more complicated.
I think that omitting it would make more sense to a human reader, but
QMP is a machine protocol, so this is not a very strong argument.
So all in all I saw neither strong arguments to omit an empty array nor
to include it. Thus I included it because that makes the code simpler.
> Can we add a new parameter: depth? For example, If I only want to know the
> quorum's
> child name, we can limit the depth, and the output may be very clear.
Good idea. I can do so in the next version, but first I'd like to hear
more opinions on what other people think of this command. If they think
it's fine, I'll include a depth parameter.
Thank you for you comments!
Max
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [RFC for-2.7 0/1] block/qapi: Add query-block-node-tree, Max Reitz, 2016/03/24
- [Qemu-devel] [RFC for-2.7 1/1] block/qapi: Add query-block-node-tree, Max Reitz, 2016/03/24
- Re: [Qemu-devel] [RFC for-2.7 1/1] block/qapi: Add query-block-node-tree, Wen Congyang, 2016/03/24
- Re: [Qemu-devel] [RFC for-2.7 1/1] block/qapi: Add query-block-node-tree,
Max Reitz <=
- Re: [Qemu-devel] [RFC for-2.7 1/1] block/qapi: Add query-block-node-tree, Wen Congyang, 2016/03/25
- Re: [Qemu-devel] [RFC for-2.7 1/1] block/qapi: Add query-block-node-tree, Max Reitz, 2016/03/26
- Re: [Qemu-devel] [RFC for-2.7 1/1] block/qapi: Add query-block-node-tree, Eric Blake, 2016/03/28
- Re: [Qemu-devel] [RFC for-2.7 1/1] block/qapi: Add query-block-node-tree, Max Reitz, 2016/03/29
- Re: [Qemu-devel] [RFC for-2.7 1/1] block/qapi: Add query-block-node-tree, Eric Blake, 2016/03/29
- Re: [Qemu-devel] [RFC for-2.7 1/1] block/qapi: Add query-block-node-tree, Max Reitz, 2016/03/29
Re: [Qemu-devel] [RFC for-2.7 0/1] block/qapi: Add query-block-node-tree, Kevin Wolf, 2016/03/29