aboutsummaryrefslogtreecommitdiff
path: root/qemu-storage-daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'qemu-storage-daemon.c')
-rw-r--r--qemu-storage-daemon.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/qemu-storage-daemon.c b/qemu-storage-daemon.c
index 5904d3c5b4..14093ac3a0 100644
--- a/qemu-storage-daemon.c
+++ b/qemu-storage-daemon.c
@@ -50,8 +50,16 @@
#include "qemu/option.h"
#include "qom/object_interfaces.h"
+#include "sysemu/runstate.h"
#include "trace/control.h"
+static volatile bool exit_requested = false;
+
+void qemu_system_killed(int signal, pid_t pid)
+{
+ exit_requested = true;
+}
+
static void help(void)
{
printf(
@@ -241,6 +249,7 @@ int main(int argc, char *argv[])
error_init(argv[0]);
qemu_init_exec_dir(argv[0]);
+ os_setup_signal_handling();
module_call_init(MODULE_INIT_QOM);
module_call_init(MODULE_INIT_TRACE);
@@ -256,5 +265,9 @@ int main(int argc, char *argv[])
qemu_init_main_loop(&error_fatal);
process_options(argc, argv);
+ while (!exit_requested) {
+ main_loop_wait(false);
+ }
+
return EXIT_SUCCESS;
}