Received: from eggs.gnu.org ([209.51.188.92]:46538) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gpeVm-0005iu-Vp for qemu-devel@nongnu.org; Fri, 01 Feb 2019 14:30:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gpeVl-0002La-04 for qemu-devel@nongnu.org; Fri, 01 Feb 2019 14:30:02 -0500 From: Max Reitz Date: Fri, 1 Feb 2019 20:29:11 +0100 Message-Id: <20190201192935.18394-8-mreitz@redhat.com> In-Reply-To: <20190201192935.18394-1-mreitz@redhat.com> References: <20190201192935.18394-1-mreitz@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v13 07/31] iotests.py: Add node_info() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, Max Reitz , Kevin Wolf 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 Reviewed-by: John Snow Reviewed-by: Alberto Garcia Reviewed-by: Eric Blake --- tests/qemu-iotests/iotests.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.p= y index 8c5dd40f83..719df561a3 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -551,6 +551,13 @@ class VM(qtest.QEMUQtestMachine): else: iotests.log(ev) =20 + def node_info(self, node_name): + nodes =3D self.qmp('query-named-block-nodes') + for x in nodes['return']: + if x['node-name'] =3D=3D node_name: + return x + return None + =20 index_re =3D re.compile(r'([^\[]+)\[([^\]]+)\]') =20 --=20 2.20.1