[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] Revert "posix-aio-compat: avoid signal race when sp
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PATCH] Revert "posix-aio-compat: avoid signal race when spawning a thread" |
Date: |
Wed, 7 Oct 2009 15:20:06 +0200 |
User-agent: |
Mutt/1.5.19 (2009-01-05) |
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 <address@hidden>
Cc: malc <address@hidden>
---
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
- [Qemu-devel] [PATCH] Revert "posix-aio-compat: avoid signal race when spawning a thread",
Michael S. Tsirkin <=
- [Qemu-devel] Re: [PATCH] Revert "posix-aio-compat: avoid signal race when spawning a thread", malc, 2009/10/07
- [Qemu-devel] Re: [PATCH] Revert "posix-aio-compat: avoid signal race when spawning a thread", Anthony Liguori, 2009/10/07
- [Qemu-devel] Re: [PATCH] Revert "posix-aio-compat: avoid signal race when spawning a thread", Michael S. Tsirkin, 2009/10/07
- [Qemu-devel] Re: [PATCH] Revert "posix-aio-compat: avoid signal race when spawning a thread", Michael S. Tsirkin, 2009/10/07
- [Qemu-devel] Re: [PATCH] Revert "posix-aio-compat: avoid signal race when spawning a thread", malc, 2009/10/07
- [Qemu-devel] Re: [PATCH] Revert "posix-aio-compat: avoid signal race when spawning a thread", Michael S. Tsirkin, 2009/10/07
- [Qemu-devel] Re: [PATCH] Revert "posix-aio-compat: avoid signal race when spawning a thread", malc, 2009/10/07
- Re: [Qemu-devel] Re: [PATCH] Revert "posix-aio-compat: avoid signal race when spawning a thread", Jamie Lokier, 2009/10/07
- Re: [Qemu-devel] Re: [PATCH] Revert "posix-aio-compat: avoid signal race when spawning a thread", malc, 2009/10/07
- Re: [Qemu-devel] Re: [PATCH] Revert "posix-aio-compat: avoid signal race when spawning a thread", Jamie Lokier, 2009/10/08