qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Frediano Ziglio <freddy77@gmail.com>
To: aliguori@us.ibm.com, kwolf@redhat.com
Cc: qemu-devel@nongnu.org, Frediano Ziglio <freddy77@gmail.com>
Subject: [Qemu-devel] [PATCH 2/2] block: avoid SIGUSR2
Date: Mon, 19 Sep 2011 13:54:17 +0200	[thread overview]
Message-ID: <1316433257-4863-3-git-send-email-freddy77@gmail.com> (raw)
In-Reply-To: <1316433257-4863-1-git-send-email-freddy77@gmail.com>


Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
---
 cpus.c             |    5 -----
 posix-aio-compat.c |   14 ++++----------
 2 files changed, 4 insertions(+), 15 deletions(-)

diff --git a/cpus.c b/cpus.c
index 54c188c..d0cfe91 100644
--- a/cpus.c
+++ b/cpus.c
@@ -380,11 +380,6 @@ static int qemu_signal_init(void)
     int sigfd;
     sigset_t set;
 
-    /* SIGUSR2 used by posix-aio-compat.c */
-    sigemptyset(&set);
-    sigaddset(&set, SIGUSR2);
-    pthread_sigmask(SIG_UNBLOCK, &set, NULL);
-
     /*
      * SIG_IPI must be blocked in the main thread and must not be caught
      * by sigwait() in the signal thread. Otherwise, the cpu thread will
diff --git a/posix-aio-compat.c b/posix-aio-compat.c
index 7ea63a1..72c6dbb 100644
--- a/posix-aio-compat.c
+++ b/posix-aio-compat.c
@@ -308,6 +308,8 @@ static ssize_t handle_aiocb_rw(struct qemu_paiocb *aiocb)
     return nbytes;
 }
 
+static void posix_aio_notify_event(void);
+
 static void *aio_thread(void *unused)
 {
     pid_t pid;
@@ -380,7 +382,7 @@ static void *aio_thread(void *unused)
         aiocb->ret = ret;
         mutex_unlock(&lock);
 
-        if (kill(pid, SIGUSR2)) die("kill failed");
+        posix_aio_notify_event();
     }
 
     cur_threads--;
@@ -547,7 +549,7 @@ static int posix_aio_flush(void *opaque)
 
 static PosixAioState *posix_aio_state;
 
-static void aio_signal_handler(int signum)
+static void posix_aio_notify_event(void)
 {
     if (posix_aio_state) {
         char byte = 0;
@@ -557,8 +559,6 @@ static void aio_signal_handler(int signum)
         if (ret < 0 && errno != EAGAIN)
             die("write()");
     }
-
-    qemu_service_io();
 }
 
 static void paio_remove(struct qemu_paiocb *acb)
@@ -662,7 +662,6 @@ BlockDriverAIOCB *paio_ioctl(BlockDriverState *bs, int fd,
 
 int paio_init(void)
 {
-    struct sigaction act;
     PosixAioState *s;
     int fds[2];
     int ret;
@@ -672,11 +671,6 @@ int paio_init(void)
 
     s = g_malloc(sizeof(PosixAioState));
 
-    sigfillset(&act.sa_mask);
-    act.sa_flags = 0; /* do not restart syscalls to interrupt select() */
-    act.sa_handler = aio_signal_handler;
-    sigaction(SIGUSR2, &act, NULL);
-
     s->first_aio = NULL;
     if (qemu_pipe(fds) == -1) {
         fprintf(stderr, "failed to create pipe\n");
-- 
1.7.1

  parent reply	other threads:[~2011-09-19 11:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-19 11:54 [Qemu-devel] [PATCH 0/2][RFC?] Remove SIGUSR2 from posix-aio Frediano Ziglio
2011-09-19 11:54 ` [Qemu-devel] [PATCH 1/2] block: avoid storing a constant in qemu_paiocb structure Frediano Ziglio
2011-09-19 11:54 ` Frediano Ziglio [this message]
2011-09-19 14:05   ` [Qemu-devel] [PATCH 2/2] block: avoid SIGUSR2 Stefan Hajnoczi
2011-09-20 18:08     ` Christoph Hellwig
2011-09-19 14:08 ` [Qemu-devel] [PATCH 0/2][RFC?] Remove SIGUSR2 from posix-aio Stefan Hajnoczi

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=1316433257-4863-3-git-send-email-freddy77@gmail.com \
    --to=freddy77@gmail.com \
    --cc=aliguori@us.ibm.com \
    --cc=kwolf@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).