qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Alexandre Raymond <cerbere@gmail.com>
Cc: pbonzini@redhat.com, andreas.faerber@web.de,
	qemu-devel@nongnu.org, agraf@suse.de
Subject: Re: [Qemu-devel] [PATCH] Fix signal handling when io-thread is disabled
Date: Tue, 14 Jun 2011 08:05:27 +0200	[thread overview]
Message-ID: <4DF6FA27.3090206@web.de> (raw)
In-Reply-To: <1308023191-7157-1-git-send-email-cerbere@gmail.com>

[-- 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 --]

  reply	other threads:[~2011-06-14  6:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2011-06-14 14:10   ` Alexandre Raymond

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DF6FA27.3090206@web.de \
    --to=jan.kiszka@web.de \
    --cc=agraf@suse.de \
    --cc=andreas.faerber@web.de \
    --cc=cerbere@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).