Commit acce87f92b8eefce3f12ddb85d63fb600794e729
1 parent
0d0ab49a
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
Showing
1 changed file
with
16 additions
and
11 deletions
block-raw-posix.c
| @@ -569,7 +569,6 @@ static int posix_aio_init(void) | @@ -569,7 +569,6 @@ static int posix_aio_init(void) | ||
| 569 | { | 569 | { |
| 570 | sigset_t mask; | 570 | sigset_t mask; |
| 571 | PosixAioState *s; | 571 | PosixAioState *s; |
| 572 | - struct aioinit ai; | ||
| 573 | 572 | ||
| 574 | if (posix_aio_state) | 573 | if (posix_aio_state) |
| 575 | return 0; | 574 | return 0; |
| @@ -590,18 +589,24 @@ static int posix_aio_init(void) | @@ -590,18 +589,24 @@ static int posix_aio_init(void) | ||
| 590 | 589 | ||
| 591 | qemu_aio_set_fd_handler(s->fd, posix_aio_read, NULL, posix_aio_flush, s); | 590 | qemu_aio_set_fd_handler(s->fd, posix_aio_read, NULL, posix_aio_flush, s); |
| 592 | 591 | ||
| 593 | - memset(&ai, 0, sizeof(ai)); | ||
| 594 | -#if !defined(__linux__) || (defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 4)) | ||
| 595 | - ai.aio_threads = 5; | ||
| 596 | - ai.aio_num = 1; | 592 | +#if defined(__linux__) |
| 593 | + { | ||
| 594 | + struct aioinit ai; | ||
| 595 | + | ||
| 596 | + memset(&ai, 0, sizeof(ai)); | ||
| 597 | +#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 4) | ||
| 598 | + ai.aio_threads = 64; | ||
| 599 | + ai.aio_num = 64; | ||
| 597 | #else | 600 | #else |
| 598 | - /* XXX: aio thread exit seems to hang on RedHat 9 and this init | ||
| 599 | - seems to fix the problem. */ | ||
| 600 | - ai.aio_threads = 1; | ||
| 601 | - ai.aio_num = 1; | ||
| 602 | - ai.aio_idle_time = 365 * 100000; | 601 | + /* XXX: aio thread exit seems to hang on RedHat 9 and this init |
| 602 | + seems to fix the problem. */ | ||
| 603 | + ai.aio_threads = 1; | ||
| 604 | + ai.aio_num = 1; | ||
| 605 | + ai.aio_idle_time = 365 * 100000; | ||
| 606 | +#endif | ||
| 607 | + aio_init(&ai); | ||
| 608 | + } | ||
| 603 | #endif | 609 | #endif |
| 604 | - aio_init(&ai); | ||
| 605 | posix_aio_state = s; | 610 | posix_aio_state = s; |
| 606 | 611 | ||
| 607 | return 0; | 612 | return 0; |