qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Revert "posix-aio-compat: avoid signal race when spawning a thread"
@ 2009-10-07 13:20 Michael S. Tsirkin
  2009-10-07 16:04 ` [Qemu-devel] " malc
  0 siblings, 1 reply; 18+ messages in thread
From: Michael S. Tsirkin @ 2009-10-07 13:20 UTC (permalink / raw)
  To: malc, qemu-devel, anthony

This reverts commit ee3993069ff55fa6f1c64daf1e09963e340db8e4.

With commit ee3993069ff55fa6f1c64daf1e09963e340db8e4,
winxp installation on a raw format file fails
during disk format, with a message "your
disk may be damaged".

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Cc: malc <av1474@comtv.ru>
---

malc, care to describe what the problem you
are solving here is?

All, could everyone please start being nice and post patches
and give time for review before applying?
Thanks!

 posix-aio-compat.c |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/posix-aio-compat.c b/posix-aio-compat.c
index 400d898..68cbec8 100644
--- a/posix-aio-compat.c
+++ b/posix-aio-compat.c
@@ -301,9 +301,14 @@ static size_t handle_aiocb_rw(struct qemu_paiocb *aiocb)
 static void *aio_thread(void *unused)
 {
     pid_t pid;
+    sigset_t set;
 
     pid = getpid();
 
+    /* block all signals */
+    if (sigfillset(&set)) die("sigfillset");
+    if (sigprocmask(SIG_BLOCK, &set, NULL)) die("sigprocmask");
+
     while (1) {
         struct qemu_paiocb *aiocb;
         size_t ret = 0;
@@ -364,18 +369,9 @@ static void *aio_thread(void *unused)
 
 static void spawn_thread(void)
 {
-    sigset_t set, oldset;
-
     cur_threads++;
     idle_threads++;
-
-    /* block all signals */
-    if (sigfillset(&set)) die("sigfillset");
-    if (sigprocmask(SIG_SETMASK, &set, &oldset)) die("sigprocmask");
-
     thread_create(&thread_id, &attr, aio_thread, NULL);
-
-    if (sigprocmask(SIG_SETMASK, &oldset, NULL)) die("sigprocmask restore");
 }
 
 static void qemu_paio_submit(struct qemu_paiocb *aiocb)
-- 
1.6.5.rc2

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

end of thread, other threads:[~2009-10-09 13:13 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-07 13:20 [Qemu-devel] [PATCH] Revert "posix-aio-compat: avoid signal race when spawning a thread" Michael S. Tsirkin
2009-10-07 16:04 ` [Qemu-devel] " malc
2009-10-07 16:28   ` Anthony Liguori
2009-10-07 16:33     ` Michael S. Tsirkin
2009-10-07 20:44     ` Michael S. Tsirkin
2009-10-07 20:54       ` malc
2009-10-07 20:55         ` Michael S. Tsirkin
2009-10-07 21:01           ` malc
2009-10-08  1:47             ` Jamie Lokier
2009-10-08  2:48               ` malc
2009-10-08 15:15                 ` Jamie Lokier
2009-10-08 16:39                   ` malc
2009-10-09 11:12                     ` Jamie Lokier
2009-10-09 13:13                       ` malc
2009-10-08 21:24                   ` Michael S. Tsirkin
2009-10-08 21:50                     ` Anthony Liguori
2009-10-08 21:51                     ` Anthony Liguori
2009-10-09 11:13                     ` Jamie Lokier

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).