aboutsummaryrefslogtreecommitdiff
path: root/block-raw-posix.c
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-26 16:12:14 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-26 16:12:14 +0000
commitacce87f92b8eefce3f12ddb85d63fb600794e729 (patch)
tree3dd634f24d31c77df73efe8ff21105d02762f732 /block-raw-posix.c
parent0d0ab49ab0ed09a44804a2c8c04fdec7400ce02b (diff)
downloadqemu-acce87f92b8eefce3f12ddb85d63fb600794e729.zip
qemu-acce87f92b8eefce3f12ddb85d63fb600794e729.tar.gz
qemu-acce87f92b8eefce3f12ddb85d63fb600794e729.tar.bz2
Really fix the BSD build this time
struct aioinit isn't defined on BSD it appears so we need to guard everything in an #if defined(__linux__). Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5325 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'block-raw-posix.c')
-rw-r--r--block-raw-posix.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/block-raw-posix.c b/block-raw-posix.c
index 8f0cead..2875fa1 100644
--- a/block-raw-posix.c
+++ b/block-raw-posix.c
@@ -569,7 +569,6 @@ static int posix_aio_init(void)
{
sigset_t mask;
PosixAioState *s;
- struct aioinit ai;
if (posix_aio_state)
return 0;
@@ -590,18 +589,24 @@ static int posix_aio_init(void)
qemu_aio_set_fd_handler(s->fd, posix_aio_read, NULL, posix_aio_flush, s);
- memset(&ai, 0, sizeof(ai));
-#if !defined(__linux__) || (defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 4))
- ai.aio_threads = 5;
- ai.aio_num = 1;
+#if defined(__linux__)
+ {
+ struct aioinit ai;
+
+ memset(&ai, 0, sizeof(ai));
+#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 4)
+ ai.aio_threads = 64;
+ ai.aio_num = 64;
#else
- /* XXX: aio thread exit seems to hang on RedHat 9 and this init
- seems to fix the problem. */
- ai.aio_threads = 1;
- ai.aio_num = 1;
- ai.aio_idle_time = 365 * 100000;
+ /* XXX: aio thread exit seems to hang on RedHat 9 and this init
+ seems to fix the problem. */
+ ai.aio_threads = 1;
+ ai.aio_num = 1;
+ ai.aio_idle_time = 365 * 100000;
+#endif
+ aio_init(&ai);
+ }
#endif
- aio_init(&ai);
posix_aio_state = s;
return 0;