diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2018-07-05 10:31:36 +0100 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2018-07-05 10:31:36 +0100 |
| commit | 5dafaf4fbceeb4c5d204039045b50b2f37443ff4 (patch) | |
| tree | db8692abda31876ebf09ba63d2e64b78c36a1aaa /scripts/qapi/events.py | |
| parent | 8beb8cc64da2868acec270e4becb9fea8f9093dc (diff) | |
| parent | 514337c142f9522f6ab89c3d2f964f446ebeb1cd (diff) | |
| download | focaccia-qemu-5dafaf4fbceeb4c5d204039045b50b2f37443ff4.tar.gz focaccia-qemu-5dafaf4fbceeb4c5d204039045b50b2f37443ff4.zip | |
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2018-07-03' into staging
QAPI patches for 2018-07-03 # gpg: Signature made Tue 03 Jul 2018 21:52:55 BST # gpg: using RSA key 3870B400EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-qapi-2018-07-03: qapi: add conditions to SPICE type/commands/events on the schema qapi: add conditions to VNC type/commands/events on the schema qapi: add 'If:' section to generated documentation qapi-types: add #if conditions to types & visitors qapi/events: add #if conditions to events qapi/commands: add #if conditions to commands qapi-introspect: add preprocessor conditions to generated QLit qapi-introspect: modify to_qlit() to append ',' on level > 0 qapi: add #if/#endif helpers qapi: mcgen() shouldn't indent # lines qapi: add 'ifcond' to visitor methods qapi: leave the ifcond attribute undefined until check() qapi: pass 'if' condition into QAPISchemaEntity objects qapi: add 'if' to top-level expressions Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'scripts/qapi/events.py')
| -rw-r--r-- | scripts/qapi/events.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py index 5657524688..764ef177ab 100644 --- a/scripts/qapi/events.py +++ b/scripts/qapi/events.py @@ -184,9 +184,11 @@ class QAPISchemaGenEventVisitor(QAPISchemaModularCVisitor): 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)) - self._genc.add(gen_event_send(name, arg_type, boxed, self._enum_name)) + def visit_event(self, name, info, ifcond, arg_type, boxed): + 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) |