mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
qapi script: add event support
qapi-event.py will parse the schema and generate qapi-event.c, then the API in qapi-event.c can be used to handle events in qemu code. All API have prefix "qapi_event". The script mainly includes two parts: generate API for each event define, generate an enum type for all defined events. Since in some cases the real emit behavior may change, for example, qemu-img would not send a event, a callback layer is used to control the behavior. As a result, the stubs at compile time can be saved, the binding of block layer code and monitor code will become looser. Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
f882126024
commit
21cd70dfc1
10 changed files with 413 additions and 5 deletions
1
tests/qapi-schema/event-nest-struct.err
Normal file
1
tests/qapi-schema/event-nest-struct.err
Normal file
|
@ -0,0 +1 @@
|
|||
tests/qapi-schema/event-nest-struct.json:1: Nested structure define in event is not supported now, event 'EVENT_A', argname 'a'
|
1
tests/qapi-schema/event-nest-struct.exit
Normal file
1
tests/qapi-schema/event-nest-struct.exit
Normal file
|
@ -0,0 +1 @@
|
|||
1
|
2
tests/qapi-schema/event-nest-struct.json
Normal file
2
tests/qapi-schema/event-nest-struct.json
Normal file
|
@ -0,0 +1,2 @@
|
|||
{ 'event': 'EVENT_A',
|
||||
'data': { 'a' : { 'string' : 'str', 'integer': 'int' }, 'b' : 'str' } }
|
0
tests/qapi-schema/event-nest-struct.out
Normal file
0
tests/qapi-schema/event-nest-struct.out
Normal file
Loading…
Add table
Add a link
Reference in a new issue