[5197] Only build compatfd when using AIO and make sure to always init AIO
Revision: 5197
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5197 Author: aliguori Date: 2008-09-11 18:00:19 +0000 (Thu, 11 Sep 2008)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/Makefile
trunk/Makefile.target
trunk/block-raw-posix.c
trunk/block.c
trunk/configure
Modified: trunk/Makefile
===================================================================
Makefile +5 -1
@@ -177,9 +177,13 @@ 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 + ###################################################################### qemu-img$(EXESUF): qemu-img.o qemu-img-block.o $(QEMU_IMG_BLOCK_OBJS)
Modified: trunk/Makefile.target
===================================================================
Makefile.target +5 -1
@@ -476,9 +476,13 @@ 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 ifdef CONFIG_ALSA LIBS += -lasound
Modified: trunk/block-raw-posix.c
===================================================================
block-raw-posix.c +3 -0
@@ -561,6 +561,9 @@return ;#endif +if (!first_aio) +return ; + do { fd_set rdfds;
Modified: trunk/block.c
===================================================================
block.c +2 -0
@@ -1328,6 +1328,8 @@#ifndef _WIN32bdrv_register (&bdrv_nbd);#endif + +qemu_aio_init (); } void *qemu_aio_get(BlockDriverState *bs, BlockDriverCompletionFunc *cb,
Modified: trunk/configure
===================================================================
configure +1 -0
@@ -1220,6 +1220,7 @@ fi if test "$aio" = "yes" ; then echo "#define CONFIG_AIO 1" >> $config_h + echo "CONFIG_AIO=yes" >> $config_mak fi # XXX: suppress that