Skip to content

Commit

Permalink
qapi: qapi-visit.py, fix list handling for union types
Browse files Browse the repository at this point in the history
Currently we assume non-list types when generating visitor routines for
union types. This is broken, since values like ['Type'] need to mapped
to 'TypeList'.

We already have a type_name() function to handle this that we use for
generating struct visitors, so use that here as well.

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Amos Kong <akong@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
  • Loading branch information
mdroth authored and Luiz Capitulino committed May 23, 2013
1 parent c0afa9c commit c664aef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/qapi-visit.py
Expand Up @@ -174,7 +174,7 @@ def generate_visit_union(name, members):
''',
abbrev = de_camel_case(name).upper(),
enum = c_fun(de_camel_case(key),False).upper(),
c_type=members[key],
c_type=type_name(members[key]),
c_name=c_fun(key))

ret += mcgen('''
Expand Down

0 comments on commit c664aef

Please sign in to comment.