docker-qemu/3.0/qemu-signals.patch

21 lines
635 B
Diff
Raw Normal View History

Origin: https://bugs.launchpad.net/qemu/+bug/1217339/comments/2
Origin: https://lists.nongnu.org/archive/html/qemu-devel/2017-03/msg03039.html
diff --git a/vl.c b/vl.c
index 1ad1c04637..9e07fe1dbb 100644
--- a/vl.c
+++ b/vl.c
@@ -1898,7 +1898,11 @@ void qemu_system_killed(int signal, pid_t pid)
/* Cannot call qemu_system_shutdown_request directly because
* we are in a signal handler.
*/
- shutdown_requested = SHUTDOWN_CAUSE_HOST_SIGNAL;
+ if (signal == SIGHUP) {
+ powerdown_requested = 1;
+ } else {
+ shutdown_requested = SHUTDOWN_CAUSE_HOST_SIGNAL;
+ }
qemu_notify_event();
}