mirror of https://gitee.com/openkylin/qemu.git
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>
This commit is contained in:
parent
a48e7542be
commit
f030ffd39d
|
@ -180,8 +180,9 @@ def _begin_module(self, name):
|
|||
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))
|
||||
|
|
Loading…
Reference in New Issue