提交 5664aed9 编写于 作者: A Alexandre Raymond 提交者: Blue Swirl

Fix signal handling when io-thread is disabled

Changes since v1:
- take pthread_sigmask() out of the ifdef as it is now common
to both parts.

This fix effectively blocks, in the main thread, the signals handled
by signalfd or the compatibility signal thread.

This way, such signals are received synchronously in the main thread
through sigfd_handler() instead of triggering the signal handler
directly, asynchronously.
Signed-off-by: NAlexandre Raymond <cerbere@gmail.com>
Acked-by: NJan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
上级 107a47cc
......@@ -401,7 +401,6 @@ static int qemu_signal_init(void)
sigaddset(&set, SIGALRM);
sigaddset(&set, SIG_IPI);
sigaddset(&set, SIGBUS);
pthread_sigmask(SIG_BLOCK, &set, NULL);
#else
sigemptyset(&set);
sigaddset(&set, SIGBUS);
......@@ -414,6 +413,7 @@ static int qemu_signal_init(void)
sigaddset(&set, SIGALRM);
}
#endif
pthread_sigmask(SIG_BLOCK, &set, NULL);
sigfd = qemu_signalfd(&set);
if (sigfd == -1) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册