summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/qapi-types.py4
-rwxr-xr-xscripts/qmp/qom-tree9
2 files changed, 9 insertions, 4 deletions
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index d28a6b07be..e6eb4b613a 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -105,7 +105,7 @@ struct %(name)s
def generate_enum_lookup(name, values):
ret = mcgen('''
-const char *%(name)s_lookup[] = {
+const char * const %(name)s_lookup[] = {
''',
name=c_name(name))
i = 0
@@ -128,7 +128,7 @@ const char *%(name)s_lookup[] = {
def generate_enum(name, values):
name = c_name(name)
lookup_decl = mcgen('''
-extern const char *%(name)s_lookup[];
+extern const char * const %(name)s_lookup[];
''',
name=name)
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)