From: Eric Blake <eblake@redhat.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: Luiz Capitulino <lcapitulino@redhat.com>,
qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] Add 'query-events' command to QMP to query async events
Date: Wed, 16 May 2012 10:04:13 -0600 [thread overview]
Message-ID: <4FB3CFFD.5090605@redhat.com> (raw)
In-Reply-To: <1337172904-20508-1-git-send-email-berrange@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1662 bytes --]
On 05/16/2012 06:55 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange@redhat.com>
>
> 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 todo just
s/todo/to do/
> 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: Split out MonitorEvent -> string conversion
> into monitor_protocol_event_name() API. Add impl of
> qmp_query_events monitor command handler
> * qapi-schema.json, qmp-commands.hx: Define contract of
> query-events command
Definitely useful for libvirt.
> +static const char *monitor_protocol_event_name(MonitorEvent event)
> +{
> switch (event) {
> case QEVENT_SHUTDOWN:
> - event_name = "SHUTDOWN";
> + return "SHUTDOWN";
> break;
These 'break' statements are now unreachable; does this matter in qemu
coding style?
> +query-events
> +--------------
> +
> +List QMP available events.
> +
> +Each event is represented by a json-object, the returned value is a json-array
> +of all events.
> +
> +Each json-object contain:
s/contain/contains/
--
Eric Blake eblake@redhat.com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 620 bytes --]
next prev parent reply other threads:[~2012-05-16 16:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-16 12:55 [Qemu-devel] [PATCH] Add 'query-events' command to QMP to query async events Daniel P. Berrange
2012-05-16 16:04 ` Eric Blake [this message]
2012-05-16 16:18 ` Anthony Liguori
2012-05-16 16:20 ` Daniel P. Berrange
2012-05-16 16:45 ` Luiz Capitulino
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FB3CFFD.5090605@redhat.com \
--to=eblake@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).