qapi/events: add #if conditions to events
commitc3cd6aa0201c126eda8dc71b60e7aa259a3e79b9
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 3 Jul 2018 15:56:44 +0000 (3 17:56 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 3 Jul 2018 16:38:54 +0000 (3 18:38 +0200)
tree14d935dc6e86ccb397c4861faa297e7a883242a4
parent1f7b9f3181ee137101cca66461c47e718b853240
qapi/events: add #if conditions to events

Wrap generated code with #if/#endif using an 'ifcontext' on
QAPIGenCSnippet objects.

This makes a conditional event's qapi_event_send_FOO() compile-time
conditional, but its enum QAPIEvent member remains unconditional for
now. A follow up patch "qapi-event: add 'if' condition to implicit
event enum" will improve this.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180703155648.11933-11-marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
scripts/qapi/events.py