Like QMP quit and host signals, UI shutdown requests force QEMU to
exit by setting shutdown_action to SHUTDOWN_ACTION_POWEROFF.
Set force_shutdown for these requests as well.

The only consumer of qemu_force_shutdown_requested() is the
vhost-user-blk stop code. When configured to skip synchronization
during forced shutdown, it should do so for UI shutdown requests
just as it does for QMP quit and host signals.

Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
---
 system/runstate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/system/runstate.c b/system/runstate.c
index 6bb839b3c0d..1958168e778 100644
--- a/system/runstate.c
+++ b/system/runstate.c
@@ -979,7 +979,8 @@ static void qemu_system_shutdown_request_safe(ShutdownCause 
reason)
 {
     shutdown_requested = reason;
     if (reason == SHUTDOWN_CAUSE_HOST_QMP_QUIT ||
-        reason == SHUTDOWN_CAUSE_HOST_SIGNAL) {
+        reason == SHUTDOWN_CAUSE_HOST_SIGNAL ||
+        reason == SHUTDOWN_CAUSE_HOST_UI) {
         force_shutdown = true;
     }
     qemu_notify_event();
-- 
2.43.0


Reply via email to