[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v11 07/31] iotests.py: Add node_info()
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH v11 07/31] iotests.py: Add node_info() |
Date: |
Mon, 8 Oct 2018 22:18:35 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 |
On 08.10.18 21:59, John Snow wrote:
>
>
> On 10/08/2018 03:57 PM, Max Reitz wrote:
>> On 08.10.18 21:34, John Snow wrote:
>>>
>>>
>>> On 10/05/2018 07:39 PM, Max Reitz wrote:
>>>> This function queries a node; since we cannot do that right now, it
>>>> executes query-named-block-nodes and returns the matching node's object.
>>>>
>>>> Signed-off-by: Max Reitz <address@hidden>
>>>> ---
>>>> tests/qemu-iotests/iotests.py | 7 +++++++
>>>> 1 file changed, 7 insertions(+)
>>>>
>>>> diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
>>>> index 5c45788dac..604f200600 100644
>>>> --- a/tests/qemu-iotests/iotests.py
>>>> +++ b/tests/qemu-iotests/iotests.py
>>>> @@ -465,6 +465,13 @@ class VM(qtest.QEMUQtestMachine):
>>>> else:
>>>> iotests.log(ev)
>>>>
>>>> + def node_info(self, node_name):
>>>> + nodes = self.qmp('query-named-block-nodes')
>>>> + for x in nodes['return']:
>>>> + if x['node-name'] == node_name:
>>>> + return x
>>>> + return None
>>>> +
>>>>
>>>> index_re = re.compile(r'([^\[]+)\[([^\]]+)\]')
>>>>
>>>>
>>>
>>> Reviewed-by: John Snow <address@hidden>
>>>
>>> Do we ever want to revisit the idea that our API should not do any
>>> pre-filtering and that it's always up to the client to do so?
>>
>> I mean we certainly want to revisit the idea that we should have a
>> proper query API.
>>
>> But what exactly do you mean by pre-filtering?
>>
>> Max
>>
>
> i.e. applying selection criteria before responding to the query. e.g.,
> by looking for matches on node-name.
>
> (Did I use i.e. and e.g. right?)
So you mean our API should do pre-filtering at the request of the client
and the client shouldn't be fed all nodes and then have to do
post-filtering?
Well, I certainly think we want a query command that doesn't return all
nodes. I personally would prefer something that only returns a single
node in the graph and its relationships, although I'm not sure whether
that is very efficient. Maybe something like inverse blockdev-add, were
the user can specify a depth on how deep references should be expanded.
Overall, I'm of the impression we want to have blockdev-reopen first so
that we have a good idea of the type of information we want to report
for a node; that being its node options, first and foremost. Probably
some stats as well, though.
Max
(The i.e. looks weird because you're not expanding a thought you've just
given, but you're actually responding to my question. It's like saying
"I want feature A." -- "We can do that, do you have any other remarks?"
-- "And I want B, too." So I would have started either with "e.g." (if
you think there are other things that could be meant by pre-filtering),
or by e.g. "I thought of". Probably the latter, since that is how I
interpreted your "i.e.".)
((Did I use the semicolon correctly?))
signature.asc
Description: OpenPGP digital signature
- [Qemu-block] [PATCH v11 03/31] block: Skip implicit nodes for filename info, (continued)
- [Qemu-block] [PATCH v11 03/31] block: Skip implicit nodes for filename info, Max Reitz, 2018/10/05
- [Qemu-block] [PATCH v11 02/31] block: Use children list in bdrv_refresh_filename, Max Reitz, 2018/10/05
- [Qemu-block] [PATCH v11 01/31] block: Use bdrv_refresh_filename() to pull, Max Reitz, 2018/10/05
- [Qemu-block] [PATCH v11 05/31] block: Respect backing bs in bdrv_refresh_filename, Max Reitz, 2018/10/05
- [Qemu-block] [PATCH v11 04/31] block: Add BDS.auto_backing_file, Max Reitz, 2018/10/05
- [Qemu-block] [PATCH v11 06/31] iotests.py: Add filter_imgfmt(), Max Reitz, 2018/10/05
- [Qemu-block] [PATCH v11 07/31] iotests.py: Add node_info(), Max Reitz, 2018/10/05
- Re: [Qemu-block] [PATCH v11 07/31] iotests.py: Add node_info(), Alberto Garcia, 2018/10/09
[Qemu-block] [PATCH v11 08/31] iotests: Add test for backing file overrides, Max Reitz, 2018/10/05
[Qemu-block] [PATCH v11 09/31] block: Make path_combine() return the path, Max Reitz, 2018/10/05
[Qemu-block] [PATCH v11 10/31] block: bdrv_get_full_backing_filename_from_...'s ret. val., Max Reitz, 2018/10/05
[Qemu-block] [PATCH v11 11/31] block: bdrv_get_full_backing_filename's ret. val., Max Reitz, 2018/10/05
[Qemu-block] [PATCH v11 12/31] block: Add bdrv_make_absolute_filename(), Max Reitz, 2018/10/05
[Qemu-block] [PATCH v11 13/31] block: Fix bdrv_find_backing_image(), Max Reitz, 2018/10/05
[Qemu-block] [PATCH v11 15/31] blkverify: Make bdrv_dirname() return NULL, Max Reitz, 2018/10/05
[Qemu-block] [PATCH v11 20/31] iotests: Add quorum case to test 110, Max Reitz, 2018/10/05
[Qemu-block] [PATCH v11 17/31] block/nbd: Make bdrv_dirname() return NULL, Max Reitz, 2018/10/05