diff --git a/qemu/scripts/qapi/events.py b/qemu/scripts/qapi/events.py index 50690a1b..007c9f79 100644 --- a/qemu/scripts/qapi/events.py +++ b/qemu/scripts/qapi/events.py @@ -185,8 +185,10 @@ class QAPISchemaGenEventVisitor(QAPISchemaModularCVisitor): genc.add(gen_enum_lookup(self._enum_name, self._event_names)) def visit_event(self, name, info, ifcond, arg_type, boxed): - self._genh.add(gen_event_send_decl(name, arg_type, boxed)) - self._genc.add(gen_event_send(name, arg_type, boxed, self._enum_name)) + with ifcontext(ifcond, self._genh, self._genc): + self._genh.add(gen_event_send_decl(name, arg_type, boxed)) + self._genc.add(gen_event_send(name, arg_type, boxed, + self._enum_name)) self._event_names.append(name)