qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Martin Cerveny <M.Cerveny@computer.org>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, Martin Cerveny <M.Cerveny@computer.org>
Subject: [Qemu-devel] [PATCH 2/2] scripts: qom-tree: add support of path as argument
Date: Wed, 13 May 2015 14:14:54 +0200	[thread overview]
Message-ID: <1431519294-8873-3-git-send-email-M.Cerveny@computer.org> (raw)
In-Reply-To: <1431519294-8873-1-git-send-email-M.Cerveny@computer.org>

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

Signed-off-by: Martin Cerveny <M.Cerveny@computer.org>
---
 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

  parent reply	other threads:[~2015-05-13 12:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-13 12:14 [Qemu-devel] [PATCH 0/2] Some fixes to qom scripts Martin Cerveny
2015-05-13 12:14 ` [Qemu-devel] [PATCH 1/2] scripts: qom-*: add network syntax Martin Cerveny
2015-05-19 12:51   ` Andreas Färber
2015-05-19 13:56     ` Eric Blake
2015-05-19 14:12       ` Martin Cerveny
2015-05-19 14:17         ` Eric Blake
2015-05-19 14:23           ` Andreas Färber
2015-05-19 14:16   ` Daniel P. Berrange
2015-05-13 12:14 ` Martin Cerveny [this message]
2015-05-14 10:00   ` [Qemu-devel] [PATCH 2/2] scripts: qom-tree: add support of path as argument Paolo Bonzini
2015-05-14 11:41     ` Martin Cerveny
2015-05-14 11:47       ` Paolo Bonzini
2015-05-19 12:47         ` Andreas Färber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1431519294-8873-3-git-send-email-M.Cerveny@computer.org \
    --to=m.cerveny@computer.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).