aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Cerveny <M.Cerveny@computer.org>2015-05-13 14:14:54 +0200
committerAndreas Färber <afaerber@suse.de>2015-06-19 10:29:14 +0200
commitff5397bc72a1716bb34302dd470343ebee7d6bf2 (patch)
treef43235ebcb3be9ec04f7a2a3a79883d97fcaf185
parent53f77e4562f85ccf82c8831a4448e9aefb538837 (diff)
scripts: Add support for path as argument of qom-tree
Add processing of optional argument path as "tree base". Signed-off-by: Martin Cerveny <M.Cerveny@computer.org> Signed-off-by: Andreas Färber <afaerber@suse.de>
-rwxr-xr-xscripts/qmp/qom-tree9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/qmp/qom-tree b/scripts/qmp/qom-tree
index aea11d4b1a..906fcd2640 100755
--- a/scripts/qmp/qom-tree
+++ b/scripts/qmp/qom-tree
@@ -65,6 +65,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)