All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Alexander Graf <agraf@suse.de>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Andreas Färber" <andreas.faerber@web.de>,
	"qemu-devel Developers" <qemu-devel@nongnu.org>,
	"Jan Kiszka" <jan.kiszka@siemens.com>
Subject: Re: [Qemu-devel] [PATCH] sigfd: use pthread_sigmask
Date: Fri, 10 Jun 2011 23:22:32 +0200	[thread overview]
Message-ID: <20110610212232.GC29885@laped.lan> (raw)
In-Reply-To: <1307573737-33421-1-git-send-email-agraf@suse.de>

On Thu, Jun 09, 2011 at 12:55:37AM +0200, Alexander Graf wrote:
> Qemu uses signalfd to figure out, if a signal occured without the need
> to actually receive the signal. Instead, it can read from the fd to receive
> its news.
> 
> Now, we obviously don't always have signalfd around. Especially not on
> non-Linux systems. So what we do there is that we create a new thread,
> block that thread on all signals and simply call sigwait to wait for a
> signal we're interested in to occur.
> 
> This all sounds great, but what we're really doing is:
> 
>     sigset_t all;
> 
>     sigfillset(&all);
>     sigprocmask(SIG_BLOCK, &all, NULL);
> 
> which - on Darwin - blocks all signals on the current _process_, not only
> on the current thread. To block signals on the thread, we can use
> pthread_sigmask().
> 
> This patch does that, assuming that my above analysis is correct, and thus
> renders Qemu useable on Darwin again.


Applied, thanks all.

Cheers


> 
> Reported-by: Andreas Färber <andreas.faerber@web.de>
> CC: Paolo Bonzini <pbonzini@redhat.com>
> CC: Jan Kiszka <jan.kiszka@siemens.com>
> CC: Anthony Liguori <anthony@codemonkey.ws>
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
>  compatfd.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/compatfd.c b/compatfd.c
> index bd377c4..41586ce 100644
> --- a/compatfd.c
> +++ b/compatfd.c
> @@ -29,7 +29,7 @@ static void *sigwait_compat(void *opaque)
>      sigset_t all;
>  
>      sigfillset(&all);
> -    sigprocmask(SIG_BLOCK, &all, NULL);
> +    pthread_sigmask(SIG_BLOCK, &all, NULL);
>  
>      while (1) {
>          int sig;
> -- 
> 1.7.1

      parent reply	other threads:[~2011-06-10 21:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-08 22:55 [Qemu-devel] [PATCH] sigfd: use pthread_sigmask Alexander Graf
2011-06-08 23:19 ` Alexandre Raymond
2011-06-09  5:59 ` Paolo Bonzini
2011-06-09  6:51 ` Jan Kiszka
2011-06-09 12:36 ` Andreas Färber
2011-06-09 15:14   ` Andreas Färber
2011-06-10 21:22 ` Edgar E. Iglesias [this message]

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=20110610212232.GC29885@laped.lan \
    --to=edgar.iglesias@gmail.com \
    --cc=agraf@suse.de \
    --cc=andreas.faerber@web.de \
    --cc=jan.kiszka@siemens.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.