Check shutdown_requested timely. After a recent merge of the ioemu-remote tree several weeks ago, I find in main() -> termsig_seup(), ioemu sets a SIGHUP handler that sets a global variable shutdown_requested to 1, but ioemu doesn't check the variable and as a result, ioemu wouldn't terminate when xend sends a SIGHUP to it; finally xend has to send a SIGKILL to it in 10 seconds. The small patch adds a check to terminate ioemu timely. Signed-off-by: Dexuan Cui diff --git a/vl.c b/vl.c index 99ebd9d..607e2c4 100644 --- a/vl.c +++ b/vl.c @@ -8052,6 +8052,10 @@ void main_loop_wait(int timeout) pioh = &ioh->next; } } + else { + if (qemu_shutdown_requested()) + exit(0); + } #if defined(CONFIG_SLIRP) if (slirp_inited) { if (ret < 0) {