qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [Qemu-devel] [PATCH] Use SIGIO with caution


From: Anthony Liguori
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] Use SIGIO with caution
Date: Tue, 31 May 2011 08:47:25 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10

On 05/29/2011 04:50 PM, Andreas Färber wrote:
BeOS and Haiku don't define SIGIO. When undefined, it won't arrive
and doesn't need to be blocked.

Signed-off-by: Andreas Färber<address@hidden>

Anything to do with signal masks is never a trivial patch BTW...

But I actually think explicit handling of SIGIO is unneeded. I think this is a hold over from the pre-I/O thread days where we selectively set SIGIO on certain file descriptors to make sure that when an IO fd became readable, we received a signal to break out of the KVM emulation loop.

Can the folks on CC confirm/deny?

I can't see any use of SIGIO in the current source tree.

Regards,

Anthony Liguori

---
  cpus.c |    8 ++++++++
  1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/cpus.c b/cpus.c
index 1fc34b7..42af291 100644
--- a/cpus.c
+++ b/cpus.c
@@ -395,7 +395,9 @@ static int qemu_signal_init(void)
      pthread_sigmask(SIG_UNBLOCK,&set, NULL);

      sigemptyset(&set);
+#ifdef SIGIO
      sigaddset(&set, SIGIO);
+#endif
      sigaddset(&set, SIGALRM);
      sigaddset(&set, SIG_IPI);
      sigaddset(&set, SIGBUS);
@@ -408,7 +410,9 @@ static int qemu_signal_init(void)
           * We need to process timer signals synchronously to avoid a race
           * between exit_request check and KVM vcpu entry.
           */
+#ifdef SIGIO
          sigaddset(&set, SIGIO);
+#endif
          sigaddset(&set, SIGALRM);
      }
  #endif
@@ -449,12 +453,16 @@ static void qemu_kvm_init_cpu_signals(CPUState *env)
  #else
      sigemptyset(&set);
      sigaddset(&set, SIG_IPI);
+#ifdef SIGIO
      sigaddset(&set, SIGIO);
+#endif
      sigaddset(&set, SIGALRM);
      pthread_sigmask(SIG_BLOCK,&set, NULL);

      pthread_sigmask(SIG_BLOCK, NULL,&set);
+#ifdef SIGIO
      sigdelset(&set, SIGIO);
+#endif
      sigdelset(&set, SIGALRM);
  #endif
      sigdelset(&set, SIG_IPI);




reply via email to

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