summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--hw/watchdog/watchdog.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/watchdog/watchdog.c b/hw/watchdog/watchdog.c
index 9f607d42bb..c307f9b57e 100644
--- a/hw/watchdog/watchdog.c
+++ b/hw/watchdog/watchdog.c
@@ -122,8 +122,12 @@ void watchdog_perform_action(void)
         exit(0);
 
     case WDT_PAUSE:             /* same as 'stop' command in monitor */
+        /* In a timer callback, when vm_stop calls qemu_clock_enable
+         * you would get a deadlock.  Bypass the problem.
+         */
+        qemu_system_vmstop_request_prepare();
         qapi_event_send_watchdog(WATCHDOG_EXPIRATION_ACTION_PAUSE, &error_abort);
-        vm_stop(RUN_STATE_WATCHDOG);
+        qemu_system_vmstop_request(RUN_STATE_WATCHDOG);
         break;
 
     case WDT_DEBUG: