From: Eric Blake <eblake@redhat.com>
To: Michal Privoznik <mprivozn@redhat.com>, qemu-devel@nongnu.org
Cc: armbru@redhat.com, berrange@redhat.com
Subject: Re: [Qemu-devel] [PATCH v4 2/3] watchdog.h: Drop local redefinition of actions enum
Date: Wed, 6 Sep 2017 10:37:48 -0500 [thread overview]
Message-ID: <6ac4f80c-3e80-297b-a4d6-2f4ae0b70d66@redhat.com> (raw)
In-Reply-To: <9fe40ce91ada6dfdade83f32940f420e8b373db2.1504696921.git.mprivozn@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1121 bytes --]
On 09/06/2017 06:24 AM, Michal Privoznik wrote:
> We already have enum that enumerates all the action that a
s/action/actions/
> watchdog can take when hitting its timeout: WatchdogAction.
> Use that instead of inventing our own.
>
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
> @@ -77,27 +77,16 @@ int select_watchdog(const char *p)
>
> int select_watchdog_action(const char *p)
> {
> - if (strcasecmp(p, "reset") == 0)
> - watchdog_action = WDT_RESET;
The old code was case-insensitive,
> + action = qapi_enum_parse(&WatchdogAction_lookup, p, -1, NULL);
the new code is not. Do we care? (I don't, but we could be breaking
someone's control flow). Should qapi_enum_parse be taught to be
case-insensitive? Or perhaps we answer related questions first: Do we
have any QAPI enums that have values differing only in case? Do we
prevent such QAPI definitions, to give us the potential of making the
parsing insensitive?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]
next prev parent reply other threads:[~2017-09-06 15:38 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-06 11:24 [Qemu-devel] [PATCH v4 0/3] watchdog: Allow setting action on the fly Michal Privoznik
2017-09-06 11:24 ` [Qemu-devel] [PATCH v4 1/3] qapi: Rename WatchdogExpirationAction enum Michal Privoznik
2017-09-06 15:34 ` Eric Blake
2017-09-06 11:24 ` [Qemu-devel] [PATCH v4 2/3] watchdog.h: Drop local redefinition of actions enum Michal Privoznik
2017-09-06 15:37 ` Eric Blake [this message]
2017-09-06 17:25 ` Markus Armbruster
2017-09-07 7:56 ` Michal Privoznik
2017-09-07 9:02 ` Markus Armbruster
2017-09-06 11:24 ` [Qemu-devel] [PATCH v4 3/3] watchdog: Allow setting action on the fly Michal Privoznik
2017-09-06 15:39 ` Eric Blake
2017-09-06 17:15 ` Markus Armbruster
2017-09-06 15:32 ` [Qemu-devel] [PATCH v4 0/3] " Markus Armbruster
2017-09-06 15:37 ` Richard W.M. Jones
2017-09-06 15:41 ` Michal Privoznik
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=6ac4f80c-3e80-297b-a4d6-2f4ae0b70d66@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=mprivozn@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).