qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] Fix signal handling when io-thread is disabl


From: Jan Kiszka
Subject: Re: [Qemu-devel] [PATCH v2] Fix signal handling when io-thread is disabled
Date: Tue, 14 Jun 2011 18:47:19 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

On 2011-06-14 16:05, Alexandre Raymond wrote:
> 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: Alexandre Raymond <address@hidden>
> ---
>  cpus.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/cpus.c b/cpus.c
> index 4ab76f0..18a1522 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -399,7 +399,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);
> @@ -412,6 +411,7 @@ static int qemu_signal_init(void)
>          sigaddset(&set, SIGALRM);
>      }
>  #endif
> +    pthread_sigmask(SIG_BLOCK, &set, NULL);
>  
>      sigfd = qemu_signalfd(&set);
>      if (sigfd == -1) {

Acked-by: Jan Kiszka <address@hidden>

Thanks,
Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux



reply via email to

[Prev in Thread] Current Thread [Next in Thread]