[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PATCH 2/2] scripts: qom-tree: add support of path as arg
From: |
Martin Cerveny |
Subject: |
[Qemu-trivial] [PATCH 2/2] scripts: qom-tree: add support of path as argument |
Date: |
Wed, 13 May 2015 14:14:54 +0200 |
Add processing of optional argument path as "tree base".
Signed-off-by: Martin Cerveny <address@hidden>
---
scripts/qmp/qom-tree | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/scripts/qmp/qom-tree b/scripts/qmp/qom-tree
index 07f8a9d..c3e3738 100755
--- a/scripts/qmp/qom-tree
+++ b/scripts/qmp/qom-tree
@@ -75,6 +75,11 @@ def list_node(path):
print ''
for item in items:
if item['type'].startswith('child<'):
- list_node(path + '/' + item['name'])
+ list_node((path if (path != '/') else '') + '/' + item['name'])
-list_node('/machine')
+if len(args) == 0:
+ path = '/'
+else:
+ path = args[0]
+
+list_node(path)
--
1.7.4.1
[Qemu-trivial] [PATCH 1/2] scripts: qom-*: add network syntax, Martin Cerveny, 2015/05/13