From: Max Reitz <mre...@redhat.com>

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 <mre...@redhat.com>
Reviewed-by: John Snow <js...@redhat.com>
Reviewed-by: Alberto Garcia <be...@igalia.com>
Reviewed-by: Eric Blake <ebl...@redhat.com>
Message-id: 20190201192935.18394-8-mre...@redhat.com
Signed-off-by: Max Reitz <mre...@redhat.com>
---
 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 d80fd7fc2a..82dd096c6e 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -543,6 +543,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'([^\[]+)\[([^\]]+)\]')
 
-- 
2.20.1


Reply via email to