From: Anthony Liguori <anthony@codemonkey.ws>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [5322] Fix build on FreeBSD
Date: Fri, 26 Sep 2008 15:52:17 +0000 [thread overview]
Message-ID: <E1KjFc9-0002bu-K3@cvs.savannah.gnu.org> (raw)
Revision: 5322
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5322
Author: aliguori
Date: 2008-09-26 15:52:17 +0000 (Fri, 26 Sep 2008)
Log Message:
-----------
Fix build on FreeBSD
__GLIBC_PREREQ is defined in such a way that the ! cannot be used in front of
it on FreeBSD. Also, -lpthread is not implied by the build and we definitely
use it for compatfd support.
While at it, I added a default initialization for posix-aio that seems to
perform well in our testing.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Modified Paths:
--------------
trunk/block-raw-posix.c
trunk/configure
Modified: trunk/block-raw-posix.c
===================================================================
--- trunk/block-raw-posix.c 2008-09-25 20:24:19 UTC (rev 5321)
+++ trunk/block-raw-posix.c 2008-09-26 15:52:17 UTC (rev 5322)
@@ -525,6 +525,7 @@
{
sigset_t mask;
PosixAioState *s;
+ struct aioinit ai;
if (posix_aio_state)
return 0;
@@ -545,18 +546,19 @@
qemu_aio_set_fd_handler(s->fd, posix_aio_read, NULL, posix_aio_flush, s);
-#if defined(__linux__) && defined(__GLIBC_PREREQ) && !__GLIBC_PREREQ(2, 4)
- {
- /* XXX: aio thread exit seems to hang on RedHat 9 and this init
- seems to fix the problem. */
- struct aioinit ai;
- memset(&ai, 0, sizeof(ai));
- ai.aio_threads = 1;
- ai.aio_num = 1;
- ai.aio_idle_time = 365 * 100000;
- aio_init(&ai);
+ memset(&ai, 0, sizeof(ai));
+#if !defined(__linux__) || (defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 4))
+ ai.aio_threads = 5;
+ ai.aio_num = 1;
+#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;
}
#endif
+ aio_init(&ai);
posix_aio_state = s;
return 0;
Modified: trunk/configure
===================================================================
--- trunk/configure 2008-09-25 20:24:19 UTC (rev 5321)
+++ trunk/configure 2008-09-26 15:52:17 UTC (rev 5322)
@@ -482,8 +482,10 @@
linux_user="no"
fi
-if [ "$bsd" = "yes" -o "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then
+if [ "$darwin" = "yes" -o "$mingw32" = "yes" ] ; then
AIOLIBS=
+elif [ "$bsd" = "yes" ]; then
+ AIOLIBS="-lpthread"
else
# Some Linux architectures (e.g. s390) don't imply -lpthread automatically.
AIOLIBS="-lrt -lpthread"
reply other threads:[~2008-09-26 15:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=E1KjFc9-0002bu-K3@cvs.savannah.gnu.org \
--to=anthony@codemonkey.ws \
--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).