qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Fix signal handling when io-thread is disabled
@ 2011-06-14  3:46 Alexandre Raymond
  2011-06-14  6:05 ` Jan Kiszka
  0 siblings, 1 reply; 3+ messages in thread
From: Alexandre Raymond @ 2011-06-14  3:46 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alexandre Raymond, pbonzini, andreas.faerber, agraf, jan.kiszka

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 <cerbere@gmail.com>
---
 cpus.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/cpus.c b/cpus.c
index 4ab76f0..b6366b5 100644
--- a/cpus.c
+++ b/cpus.c
@@ -411,6 +411,7 @@ static int qemu_signal_init(void)
         sigaddset(&set, SIGIO);
         sigaddset(&set, SIGALRM);
     }
+    pthread_sigmask(SIG_BLOCK, &set, NULL);
 #endif
 
     sigfd = qemu_signalfd(&set);
-- 
1.7.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] Fix signal handling when io-thread is disabled
  2011-06-14  3:46 [Qemu-devel] [PATCH] Fix signal handling when io-thread is disabled Alexandre Raymond
@ 2011-06-14  6:05 ` Jan Kiszka
  2011-06-14 14:10   ` Alexandre Raymond
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2011-06-14  6:05 UTC (permalink / raw)
  To: Alexandre Raymond; +Cc: pbonzini, andreas.faerber, qemu-devel, agraf

[-- Attachment #1: Type: text/plain, Size: 1056 bytes --]

On 2011-06-14 05:46, Alexandre Raymond wrote:
> 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 <cerbere@gmail.com>
> ---
>  cpus.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/cpus.c b/cpus.c
> index 4ab76f0..b6366b5 100644
> --- a/cpus.c
> +++ b/cpus.c
> @@ -411,6 +411,7 @@ static int qemu_signal_init(void)
>          sigaddset(&set, SIGIO);
>          sigaddset(&set, SIGALRM);
>      }
> +    pthread_sigmask(SIG_BLOCK, &set, NULL);
>  #endif
>  
>      sigfd = qemu_signalfd(&set);

Good catch. Probably remained unnoticed as most of us have signalfd
support on their boxes so that the window for async delivery was rather
small.

But please pull the now common pthread_sigmask out of the #ifdef.

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] Fix signal handling when io-thread is disabled
  2011-06-14  6:05 ` Jan Kiszka
@ 2011-06-14 14:10   ` Alexandre Raymond
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Raymond @ 2011-06-14 14:10 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: pbonzini, andreas.faerber, qemu-devel, agraf

Hi Jan,

Thanks for reviewing my patch.

> But please pull the now common pthread_sigmask out of the #ifdef.
Please see v2.

Alexandre

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-06-14 14:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-14  3:46 [Qemu-devel] [PATCH] Fix signal handling when io-thread is disabled Alexandre Raymond
2011-06-14  6:05 ` Jan Kiszka
2011-06-14 14:10   ` Alexandre Raymond

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).