From d1f07c86c05706facf950b0b0dba370f71fd5ef6 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 14 May 2015 06:51:00 -0600 Subject: 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 Signed-off-by: Markus Armbruster --- scripts/qapi-types.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts/qapi-types.py') 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(''' }; -- cgit 1.4.1