From: Eric Blake <eblake@redhat.com>
To: Wenchao Xia <wenchaoqemu@gmail.com>, qemu-devel@nongnu.org
Cc: mdroth@linux.vnet.ibm.com, armbru@redhat.com, lcapitulino@redhat.com
Subject: Re: [Qemu-devel] [PATCH V6 17/29] qapi event: convert WATCHDOG
Date: Fri, 13 Jun 2014 15:47:16 -0600 [thread overview]
Message-ID: <539B7164.1030407@redhat.com> (raw)
In-Reply-To: <1401970944-18735-18-git-send-email-wenchaoqemu@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2930 bytes --]
On 06/05/2014 06:22 AM, Wenchao Xia wrote:
> Signed-off-by: Wenchao Xia <wenchaoqemu@gmail.com>
> ---
> docs/qmp/qmp-events.txt | 19 -------------------
> hw/watchdog/watchdog.c | 23 +++++++----------------
> monitor.c | 2 +-
> qapi-event.json | 15 +++++++++++++++
> qapi-schema.json | 24 ++++++++++++++++++++++++
> 5 files changed, 47 insertions(+), 36 deletions(-)
>
> @@ -117,31 +108,31 @@ void watchdog_perform_action(void)
> {
> switch(watchdog_action) {
Worth fixing the missing space after switch while touching this area of
code?
> case WDT_RESET: /* same as 'system_reset' in monitor */
> - watchdog_mon_event("reset");
> + qapi_event_send_watchdog(WATCHDOG_EXPIRATION_ACTION_RESET, NULL);
More instances of ignoring the errp argument, where eliminating it might
be nicer.
> +##
> +# @WATCHDOG
> +#
> +# Emitted when the watchdog device's timer is expired
> +#
> +# @action: action that has been taken
> +#
> +# Note: If action is "reset", "shutdown", or "pause" the WATCHDOG event is
> +# followed respectively by the RESET, SHUTDOWN, or STOP events
> +#
> +# Since: 2.1
0.14.0
> + 'data': { 'action': 'WatchdogExpirationAction' } }
Hmm. You've managed to create error.json in such a manner that it is
not self-sufficient. If some other file includes error.json, it must
also define WatchdogExpirationAction or it will fail the generators.
> +++ b/qapi-schema.json
> +##
> +# @WatchdogExpirationAction
I think you will be better off to ensure that error.json is
self-sufficient, perhaps by sticking any data type it references
directly into common.json rather than qapi-schema.json, and having
error.json include common.json. (This is the first instance of
referencing an external type, but other events later in the series have
the same issue).
> +# Since: 2.1
> +##
> +{ 'enum': 'WatchdogExpirationAction',
> + 'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none' ] }
Nice conversion of open-coded string to an enum. While I've been asking
for the earliest QMP version for Since fields on event objects proper,
here, I think you're okay keeping the 'since 2.1' indication. Why?
Because we already have other examples in the code base of converting
open-coded strings to an enum, where the QMP wire format is the same,
but where the version claimed on those enums was the qemu version that
did the conversion rather than the age of the command being converted.
(Maybe we could audit all of those conversions and retroactively update
their Since field, or even come up with a notation for wire-stability
release vs. QAPI introspection release - but that sounds like more pain
than necessary with no obvious benefit)
--
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: 604 bytes --]
next prev parent reply other threads:[~2014-06-13 21:47 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-05 12:21 [Qemu-devel] [PATCH V6 00/29] add direct support of event in qapi schema Wenchao Xia
2014-06-05 12:21 ` [Qemu-devel] [PATCH V6 01/29] os-posix: include sys/time.h Wenchao Xia
2014-06-05 12:21 ` [Qemu-devel] [PATCH V6 02/29] qapi: add event helper functions Wenchao Xia
2014-06-05 12:21 ` [Qemu-devel] [PATCH V6 03/29] qapi script: add event support Wenchao Xia
2014-06-13 16:47 ` Eric Blake
2014-06-13 21:28 ` Eric Blake
2014-06-18 3:33 ` Eric Blake
2014-06-18 6:06 ` Paolo Bonzini
2014-06-18 22:45 ` Wenchao Xia
2014-06-18 3:50 ` Eric Blake
2014-06-05 12:21 ` [Qemu-devel] [PATCH V6 04/29] test: add test cases for qapi event Wenchao Xia
2014-06-13 17:05 ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 05/29] qapi: adjust existing defines Wenchao Xia
2014-06-13 17:32 ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 06/29] monitor: add an implemention as qapi event emit method Wenchao Xia
2014-06-13 19:04 ` Eric Blake
2014-06-15 0:27 ` Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 07/29] qapi: add new schema file qapi-event.json Wenchao Xia
2014-06-13 19:25 ` Eric Blake
2014-06-13 19:45 ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 08/29] qapi event: convert SHUTDOWN Wenchao Xia
2014-06-13 19:57 ` Eric Blake
2014-06-15 0:32 ` Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 09/29] qapi event: convert POWERDOWN Wenchao Xia
2014-06-13 20:02 ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 10/29] qapi event: convert RESET Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 11/29] qapi event: convert STOP Wenchao Xia
2014-06-13 20:29 ` Eric Blake
2014-06-17 9:17 ` Paolo Bonzini
2014-06-17 13:18 ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 12/29] qapi event: convert RESUME Wenchao Xia
2014-06-13 20:33 ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 13/29] qapi event: convert SUSPEND Wenchao Xia
2014-06-13 20:40 ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 14/29] qapi event: convert SUSPEND_DISK Wenchao Xia
2014-06-13 20:42 ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 15/29] qapi event: convert WAKEUP Wenchao Xia
2014-06-13 20:57 ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 16/29] qapi event: convert RTC_CHANGE Wenchao Xia
2014-06-13 21:27 ` Eric Blake
2014-06-15 0:38 ` Wenchao Xia
2014-06-15 14:01 ` Paolo Bonzini
2014-06-15 14:00 ` Paolo Bonzini
2014-06-17 9:21 ` Paolo Bonzini
2014-06-17 13:19 ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 17/29] qapi event: convert WATCHDOG Wenchao Xia
2014-06-13 21:47 ` Eric Blake [this message]
2014-06-13 22:05 ` Eric Blake
2014-06-15 0:45 ` Wenchao Xia
2014-06-17 9:23 ` Paolo Bonzini
2014-06-17 13:21 ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 18/29] qapi event: convert DEVICE_DELETED Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 19/29] qapi event: convert DEVICE_TRAY_MOVED Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 20/29] qapi event: convert BLOCK_IO_ERROR and BLOCK_JOB_ERROR Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 21/29] qapi event: convert BLOCK_IMAGE_CORRUPTED Wenchao Xia
2014-06-16 22:53 ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 22/29] qapi event: convert other BLOCK_JOB events Wenchao Xia
2014-06-16 22:57 ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 23/29] qapi event: convert NIC_RX_FILTER_CHANGED Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 24/29] qapi event: convert VNC events Wenchao Xia
2014-06-16 23:01 ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 25/29] qapi event: convert SPICE events Wenchao Xia
2014-06-16 23:05 ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 26/29] qapi event: convert BALLOON_CHANGE Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 27/29] qapi event: convert GUEST_PANICKED Wenchao Xia
2014-06-16 14:08 ` Eric Blake
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 28/29] qapi event: convert QUORUM events Wenchao Xia
2014-06-05 12:22 ` [Qemu-devel] [PATCH V6 29/29] qapi event: clean up Wenchao Xia
2014-06-16 14:09 ` Eric Blake
2014-06-10 5:48 ` [Qemu-devel] [PATCH V6 00/29] add direct support of event in qapi schema Paolo Bonzini
2014-06-15 0:52 ` Wenchao Xia
2014-06-17 10:57 ` Paolo Bonzini
2014-06-17 16:05 ` Eric Blake
2014-06-17 16:30 ` Paolo Bonzini
2014-06-17 22:10 ` Wenchao Xia
2014-06-18 4:00 ` Eric Blake
2014-06-18 6:07 ` Paolo Bonzini
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=539B7164.1030407@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=wenchaoqemu@gmail.com \
/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).