From: Marc-André Lureau Date: Thu, 13 Dec 2018 12:37:12 +0000 (+0400) Subject: qapi-events: add 'if' condition to implicit event enum X-Git-Tag: v4.0.0-rc0~210^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7bd263490590ee6fcf34ecb6203437e22f6e5a9c;p=thirdparty%2Fqemu.git qapi-events: add 'if' condition to implicit event enum Add condition to QAPIEvent enum members based on the event 'if'. The generated code remains unconditional for now. Later patches generate the conditionals (also there is no additional coverage of this change in qapi-schema-test.out since the event_names enum is an implicit type created by qapi/events.py). Signed-off-by: Marc-André Lureau Reviewed-by: Markus Armbruster Message-Id: <20181213123724.4866-11-marcandre.lureau@redhat.com> Signed-off-by: Markus Armbruster --- diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py index f1b88d8786f..37ee5de6823 100644 --- a/scripts/qapi/events.py +++ b/scripts/qapi/events.py @@ -179,7 +179,7 @@ class QAPISchemaGenEventVisitor(QAPISchemaModularCVisitor): self._genh.add(gen_event_send_decl(name, arg_type, boxed)) self._genc.add(gen_event_send(name, arg_type, boxed, self._event_enum_name)) - self._event_enum_members.append(QAPISchemaMember(name)) + self._event_enum_members.append(QAPISchemaMember(name, ifcond)) def gen_events(schema, output_dir, prefix):