summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorBo Tu <tubo@linux.vnet.ibm.com>2016-01-19 08:45:19 +0100
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:29:55 -0600
commit902b533a3a9b11556c7b6baaadb5a0fc7433a31c (patch)
treec77b915c0c0431f632d271c3bb6e9c15b59a8da7 /hw
parent19bf23c167ad8d38692dfb989afc7cb096fd11f9 (diff)
downloadhqemu-902b533a3a9b11556c7b6baaadb5a0fc7433a31c.zip
hqemu-902b533a3a9b11556c7b6baaadb5a0fc7433a31c.tar.gz
watchdog/diag288: don't reset for action=none|debug|pause
If the watchdog expires and the guest is not notified (NONE, DEBUG, PAUSE), we must not reset the watchdog device, otherwise watchdog_ping() and watchdog_stop() will fail when triggered by the guest. This reset behavior matches to the z/VM behavior when a custom command is to be executed on expiry. Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Bo Tu <tubo@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/watchdog/wdt_diag288.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/hw/watchdog/wdt_diag288.c b/hw/watchdog/wdt_diag288.c
index 2a885a4..ddda723 100644
--- a/hw/watchdog/wdt_diag288.c
+++ b/hw/watchdog/wdt_diag288.c
@@ -51,6 +51,13 @@ static void diag288_timer_expired(void *dev)
{
qemu_log_mask(CPU_LOG_RESET, "Watchdog timer expired.\n");
watchdog_perform_action();
+ /* Reset the watchdog only if the guest was notified about expiry. */
+ switch (get_watchdog_action()) {
+ case WDT_DEBUG:
+ case WDT_NONE:
+ case WDT_PAUSE:
+ return;
+ }
wdt_diag288_reset(dev);
}
OpenPOWER on IntegriCloud