From: "Daniel P. Berrange" <berrange@redhat.com>
To: Michal Privoznik <mprivozn@redhat.com>
Cc: qemu-devel@nongnu.org, armbru@redhat.com
Subject: Re: [Qemu-devel] [PATCH v5 3/3] watchdog: Allow setting action on the fly
Date: Tue, 12 Sep 2017 14:04:42 +0100 [thread overview]
Message-ID: <20170912130442.GI17633@redhat.com> (raw)
In-Reply-To: <35d6ce6fe3d357122d73b8272bc8198134c74104.1504771369.git.mprivozn@redhat.com>
On Thu, Sep 07, 2017 at 10:05:26AM +0200, 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.
>
> Inspired by: https://bugzilla.redhat.com/show_bug.cgi?id=1447169
>
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
> hw/watchdog/watchdog.c | 8 +++++++-
> qapi-schema.json | 9 +++++++++
> 2 files changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c
> index 0d3eeed187..670114ecfe 100644
> --- a/hw/watchdog/watchdog.c
> +++ b/hw/watchdog/watchdog.c
> @@ -29,6 +29,7 @@
> #include "qapi-event.h"
> #include "hw/nmi.h"
> #include "qemu/help_option.h"
> +#include "qmp-commands.h"
>
> static WatchdogAction watchdog_action = WATCHDOG_ACTION_RESET;
> static QLIST_HEAD(watchdog_list, WatchdogTimerModel) watchdog_list;
> @@ -85,7 +86,7 @@ int select_watchdog_action(const char *p)
> g_free(qapi_value);
> if (action < 0)
> return -1;
> - watchdog_action = action;
> + qmp_watchdog_set_action(action, &error_abort);
> return 0;
> }
>
> @@ -142,3 +143,8 @@ void watchdog_perform_action(void)
> assert(0);
> }
> }
> +
> +void qmp_watchdog_set_action(WatchdogAction action, Error **errp)
> +{
> + watchdog_action = action;
> +}
> diff --git a/qapi-schema.json b/qapi-schema.json
> index f3af2cb851..f5db401838 100644
> --- a/qapi-schema.json
> +++ b/qapi-schema.json
> @@ -3143,3 +3143,12 @@
> # Since 2.9
> ##
> { 'command': 'query-vm-generation-id', 'returns': 'GuidInfo' }
> +
> +##
> +# @watchdog-set-action:
> +#
> +# Set watchdog action
> +#
> +# Since 2.11
Not sure how much it matters, but the standard syntax has a ':' following
the 'Since' word
I do notice that query-vm-generation-id violates this rule though, which
I what I guess you copied ?
> +##
> +{ 'command': 'watchdog-set-action', 'data' : {'action': 'WatchdogAction'} }
> --
Assuming the ':' is added in next posting (or by the committer), then
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2017-09-12 13:04 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-07 8:05 [Qemu-devel] [PATCH v5 0/3] watchdog.h: Drop local redefinition of actions enum Michal Privoznik
2017-09-07 8:05 ` [Qemu-devel] [PATCH v5 1/3] qapi: Rename WatchdogExpirationAction enum Michal Privoznik
2017-09-12 13:00 ` Daniel P. Berrange
2017-09-07 8:05 ` [Qemu-devel] [PATCH v5 2/3] watchdog.h: Drop local redefinition of actions enum Michal Privoznik
2017-09-12 13:02 ` Daniel P. Berrange
2017-09-07 8:05 ` [Qemu-devel] [PATCH v5 3/3] watchdog: Allow setting action on the fly Michal Privoznik
2017-09-12 13:04 ` Daniel P. Berrange [this message]
2017-10-02 6:49 ` Markus Armbruster
2017-09-07 13:35 ` [Qemu-devel] [PATCH v5 0/3] watchdog.h: Drop local redefinition of actions enum Eric Blake
2017-09-07 13:47 ` Markus Armbruster
2017-09-22 13:14 ` Michal Privoznik
2017-10-02 6:54 ` Markus Armbruster
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=20170912130442.GI17633@redhat.com \
--to=berrange@redhat.com \
--cc=armbru@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.