[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] watchdog: Allow setting action on the fly
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v2] watchdog: Allow setting action on the fly |
Date: |
Tue, 5 Sep 2017 15:36:15 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 |
On 09/05/2017 08:22 AM, Michal Privoznik wrote:
> Currently, the only time that users can set watchdog action is at
> the start as all we expose is this -watchdog-action command line
> argument. This is suboptimal when users want to plug the device
> later via monitor. Alternatively, they might want to change the
> action for already existing device on the fly.
>
> At the same time, drop local redefinition of the actions eum in
s/eum/enum/
> watchdog.h in favour of the ones defined in schema.
>
> Inspired by: https://bugzilla.redhat.com/show_bug.cgi?id=1447169
>
> Signed-off-by: Michal Privoznik <address@hidden>
> ---
> @@ -77,27 +80,17 @@ int select_watchdog(const char *p)
>
> int select_watchdog_action(const char *p)
> {
> + int action;
>
> + action = qapi_enum_parse(WatchdogExpirationAction_lookup, p,
> + WATCHDOG_EXPIRATION_ACTION__MAX, -1, NULL);
Semantic conflict; you need to rebase now that the qapi enum lookup code
has landed (see commit ebf677c8 and parents)
> +
> + case WATCHDOG_EXPIRATION_ACTION__MAX:
> + /* keep gcc happy */
> + break;
Could use g_assert_not_reached() here instead.
> +++ b/qapi-schema.json
> @@ -6539,3 +6539,12 @@
> # Since 2.9
> ##
> { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
> +
> +##
> +# @watchdog-set-action:
> +#
> +# Set watchdog action
> +#
> +# Since 2.11
> +##
> +{ 'command': 'watchdog-set-action', 'data' : {'action':
> 'WatchdogExpirationAction'} }
Can a machine have more than one watchdog device, in which case you'd
want a device name to select which watchdog gets which action? But the
command-line version that you are replacing seems to be global, so I
guess you're okay with this interface.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature