• Daniel P. Berrange's avatar
    Add 'query-events' command to QMP to query async events · 4860853d
    Daniel P. Berrange authored
    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: default avatarDaniel P. Berrange <berrange@redhat.com>
    Signed-off-by: default avatarLuiz Capitulino <lcapitulino@redhat.com>
    4860853d
qapi-schema.json 53.2 KB