]> git.proxmox.com Git - mirror_qemu.git/commitdiff
Only build compatfd when using AIO and make sure to always init AIO
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 11 Sep 2008 18:00:19 +0000 (18:00 +0000)
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Thu, 11 Sep 2008 18:00:19 +0000 (18:00 +0000)
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

Makefile
Makefile.target
block-raw-posix.c
block.c
configure

index e6769001a8be7e1d0d4cb07c984f3c434a6744ec..708941cf420bfbb2f36fb78e918ee174bc079f40 100644 (file)
--- 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
 
 ######################################################################
index dd511ef9dfb1a26f152b6520cf20765486bf403e..d02d896afeafc11670d1410bdee146f9d5715bd0 100644 (file)
@@ -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
index 0587950c8f1abcf7bf980db38c6da4f1fefca3f5..eaf3bf26957807004433fde5e1747d28be82cdcd 100644 (file)
@@ -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 a6fd0b1c56c6b9824bb50239bd37f28c71e0e5b8..e81df0a79bd5e9c8fbc3faba6e403895e24ed254 100644 (file)
--- 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,
index f1ee0af90db4271ce838c9194d3545811de0be0a..1da42a1c3daebbca2b54e55caa0c76da33368c29 100755 (executable)
--- 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