aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2018-03-21 12:51:24 +0100
committerMarkus Armbruster <armbru@redhat.com>2018-06-22 16:33:46 +0200
commitf030ffd39d6c1ea8fff281be5e4b19c819d7ce10 (patch)
tree30a7aa7f84d8f6ba251fa3a2a2ee2f1061ee403b /scripts/qapi
parenta48e7542be9ef6dab3c8d52f563298d06ef872c9 (diff)
qapi/events: generate event enum in main module
The event generator produces an enum, and put it in the last visited module. It fits better in the main module, since it's the set of all visited events, from all modules. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20180321115211.17937-3-marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts/qapi')
-rw-r--r--scripts/qapi/events.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py
index 4426861ff1..5657524688 100644
--- a/scripts/qapi/events.py
+++ b/scripts/qapi/events.py
@@ -180,8 +180,9 @@ class QAPISchemaGenEventVisitor(QAPISchemaModularCVisitor):
types=types))
def visit_end(self):
- self._genh.add(gen_enum(self._enum_name, self._event_names))
- self._genc.add(gen_enum_lookup(self._enum_name, self._event_names))
+ (genc, genh) = self._module[self._main_module]
+ genh.add(gen_enum(self._enum_name, self._event_names))
+ genc.add(gen_enum_lookup(self._enum_name, self._event_names))
def visit_event(self, name, info, arg_type, boxed):
self._genh.add(gen_event_send_decl(name, arg_type, boxed))