summaryrefslogtreecommitdiffstats
path: root/scripts/qapi-visit.py
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-02-16 16:39:25 -0700
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:45:29 -0600
commit011b118064e6d1f779c206f9f05349bd64c4aa5d (patch)
tree503c23fcd59272bc0cd75ebbfd88e407dae737af /scripts/qapi-visit.py
parent7b63a52784b30e15cd5da84f2de3030ea8c13160 (diff)
downloadhqemu-011b118064e6d1f779c206f9f05349bd64c4aa5d.zip
hqemu-011b118064e6d1f779c206f9f05349bd64c4aa5d.tar.gz
qapi-visit: Honor prefix of discriminator enum
When we added support for a user-specified prefix for an enum type (commit 351d36e), we forgot to teach the qapi-visit code to honor that prefix in the case of using a prefixed enum as the discriminator for a flat union. While there is still some on-list debate on whether we want to keep prefixes, we should at least make it work as long as it is still part of the code base. Reported-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1455665965-27638-1-git-send-email-eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts/qapi-visit.py')
-rw-r--r--scripts/qapi-visit.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py
index 0cc9b08..2bdb5a1 100644
--- a/scripts/qapi-visit.py
+++ b/scripts/qapi-visit.py
@@ -293,7 +293,8 @@ void visit_type_%(c_name)s(Visitor *v, const char *name, %(c_name)s **obj, Error
case %(case)s:
''',
case=c_enum_const(variants.tag_member.type.name,
- var.name))
+ var.name,
+ variants.tag_member.type.prefix))
if simple_union_type:
ret += mcgen('''
visit_type_%(c_type)s(v, "data", &(*obj)->u.%(c_name)s, &err);
OpenPOWER on IntegriCloud