aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-11 18:00:19 +0000
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>2008-09-11 18:00:19 +0000
commita3392f9b100e6b63616922a8b30ad9643c62785a (patch)
tree00577aa3082c3742a4a4e8917909ab354c84572e
parent5068cbd9e9ef1bec70b5c04650a12d8d8bb7ff3d (diff)
Only build compatfd when using AIO and make sure to always init AIO
OpenBSD doesn't use AIO so don't try to build compatfd when not using AIO. Also make sure to call qemu_aio_init() from bdrv_init. Everything that uses bdrv calls bdrv_init so it makes sense to init aio from there instead of in every single tool. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5197 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--Makefile6
-rw-r--r--Makefile.target6
-rw-r--r--block-raw-posix.c3
-rw-r--r--block.c2
-rwxr-xr-xconfigure1
5 files changed, 16 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index e6769001a8..708941cf42 100644
--- a/Makefile
+++ b/Makefile
@@ -177,7 +177,11 @@ QEMU_IMG_BLOCK_OBJS = $(BLOCK_OBJS)
ifdef CONFIG_WIN32
QEMU_IMG_BLOCK_OBJS += qemu-img-block-raw-win32.o
else
-QEMU_IMG_BLOCK_OBJS += nbd.o qemu-img-block-raw-posix.o compatfd.o
+QEMU_IMG_BLOCK_OBJS += nbd.o qemu-img-block-raw-posix.o
+endif
+
+ifdef CONFIG_AIO
+QEMU_IMG_BLOCK_OBJS += compatfd.o
endif
######################################################################
diff --git a/Makefile.target b/Makefile.target
index dd511ef9df..d02d896afe 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -476,7 +476,11 @@ OBJS=vl.o osdep.o monitor.o pci.o loader.o isa_mmio.o machine.o net-checksum.o
ifdef CONFIG_WIN32
OBJS+=block-raw-win32.o
else
-OBJS+=block-raw-posix.o compatfd.o
+OBJS+=block-raw-posix.o
+endif
+
+ifdef CONFIG_AIO
+OBJS+=compatfd.o
endif
LIBS+=-lz
diff --git a/block-raw-posix.c b/block-raw-posix.c
index 0587950c8f..eaf3bf2695 100644
--- a/block-raw-posix.c
+++ b/block-raw-posix.c
@@ -561,6 +561,9 @@ void qemu_aio_wait(void)
return;
#endif
+ if (!first_aio)
+ return;
+
do {
fd_set rdfds;
diff --git a/block.c b/block.c
index a6fd0b1c56..e81df0a79b 100644
--- a/block.c
+++ b/block.c
@@ -1328,6 +1328,8 @@ void bdrv_init(void)
#ifndef _WIN32
bdrv_register(&bdrv_nbd);
#endif
+
+ qemu_aio_init();
}
void *qemu_aio_get(BlockDriverState *bs, BlockDriverCompletionFunc *cb,
diff --git a/configure b/configure
index f1ee0af90d..1da42a1c3d 100755
--- a/configure
+++ b/configure
@@ -1220,6 +1220,7 @@ if test "$brlapi" = "yes" ; then
fi
if test "$aio" = "yes" ; then
echo "#define CONFIG_AIO 1" >> $config_h
+ echo "CONFIG_AIO=yes" >> $config_mak
fi
# XXX: suppress that