summary refs log tree commit diff stats
path: root/scripts/qapi-types.py
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2015-05-14 06:51:00 -0600
committerMarkus Armbruster <armbru@redhat.com>2015-05-14 18:21:24 +0200
commitd1f07c86c05706facf950b0b0dba370f71fd5ef6 (patch)
tree31f417913e96b1f24fd22b3e9976b65be57cfcd9 /scripts/qapi-types.py
parent857af5f06c3fb097d1bb6bc8a23b9992aac99e75 (diff)
downloadfocaccia-qemu-d1f07c86c05706facf950b0b0dba370f71fd5ef6.tar.gz
focaccia-qemu-d1f07c86c05706facf950b0b0dba370f71fd5ef6.zip
qapi: Support downstream alternates
Enhance the testsuite to cover downstream alternates, including
whether the branch name or type is downstream.  Update the
generator to mangle alternate names in the appropriate places.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts/qapi-types.py')
-rw-r--r--scripts/qapi-types.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/scripts/qapi-types.py b/scripts/qapi-types.py
index 13e4b530f9..56651451c9 100644
--- a/scripts/qapi-types.py
+++ b/scripts/qapi-types.py
@@ -174,16 +174,17 @@ def generate_alternate_qtypes(expr):
     ret = mcgen('''
 const int %(name)s_qtypes[QTYPE_MAX] = {
 ''',
-    name=name)
+                name=c_name(name))
 
     for key in members:
         qtype = find_alternate_member_qtype(members[key])
         assert qtype, "Invalid alternate member"
 
         ret += mcgen('''
-    [ %(qtype)s ] = %(enum_const)s,
+    [%(qtype)s] = %(enum_const)s,
 ''',
-        qtype = qtype, enum_const = c_enum_const(name + 'Kind', key))
+                     qtype = qtype,
+                     enum_const = c_enum_const(name + 'Kind', key))
 
     ret += mcgen('''
 };