mirror of https://github.com/xemu-project/xemu.git
iotests.py: Add node_info()
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 <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 20190201192935.18394-8-mreitz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
f2ea0b2082
commit
ef7afd6399
|
@ -543,6 +543,13 @@ class VM(qtest.QEMUQtestMachine):
|
||||||
else:
|
else:
|
||||||
iotests.log(ev)
|
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'([^\[]+)\[([^\]]+)\]')
|
index_re = re.compile(r'([^\[]+)\[([^\]]+)\]')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue