qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 04/12] scripts: Add support for path as argument of q


From: Andreas Färber
Subject: [Qemu-devel] [PULL 04/12] scripts: Add support for path as argument of qom-tree
Date: Wed, 20 May 2015 17:51:38 +0200

From: Martin Cerveny <address@hidden>

Add processing of optional argument path as "tree base".

Signed-off-by: Martin Cerveny <address@hidden>
Signed-off-by: Andreas Färber <address@hidden>
---
 scripts/qmp/qom-tree | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/scripts/qmp/qom-tree b/scripts/qmp/qom-tree
index aea11d4..906fcd2 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)
-- 
2.1.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]