mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-03-09 04:24:44 -06:00
Add 'query-events' command to QMP to query async events
Sometimes it is neccessary for an application to determine
whether a particular QMP event is available, so they can
decide whether to use compatibility code instead. This
introduces a new 'query-events' command to QMP to do just
that
{ "execute": "query-events" }
{"return": [{"name": "WAKEUP"},
{"name": "SUSPEND"},
{"name": "DEVICE_TRAY_MOVED"},
{"name": "BLOCK_JOB_CANCELLED"},
{"name": "BLOCK_JOB_COMPLETED"},
...snip...
{"name": "SHUTDOWN"}]}
* monitor.c: Turn MonitorEvent -> string conversion
into a lookup from a static table of constant strings.
Add impl of qmp_query_events monitor command handler
* qapi-schema.json, qmp-commands.hx: Define contract of
query-events command
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
This commit is contained in:
parent
5f96415527
commit
4860853d60
4 changed files with 108 additions and 62 deletions
|
|
@ -227,6 +227,28 @@
|
|||
##
|
||||
{ 'command': 'query-commands', 'returns': ['CommandInfo'] }
|
||||
|
||||
##
|
||||
# @EventInfo:
|
||||
#
|
||||
# Information about a QMP event
|
||||
#
|
||||
# @name: The event name
|
||||
#
|
||||
# Since: 1.2.0
|
||||
##
|
||||
{ 'type': 'EventInfo', 'data': {'name': 'str'} }
|
||||
|
||||
##
|
||||
# @query-events:
|
||||
#
|
||||
# Return a list of supported QMP events by this server
|
||||
#
|
||||
# Returns: A list of @EventInfo for all supported events
|
||||
#
|
||||
# Since: 1.2.0
|
||||
##
|
||||
{ 'command': 'query-events', 'returns': ['EventInfo'] }
|
||||
|
||||
##
|
||||
# @MigrationStats
|
||||
#
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue