Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KdqSv-0006if-Cy for qemu-devel@nongnu.org; Thu, 11 Sep 2008 14:00:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KdqSu-0006iB-HH for qemu-devel@nongnu.org; Thu, 11 Sep 2008 14:00:24 -0400 Received: from [199.232.76.173] (port=45440 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KdqSt-0006i1-RP for qemu-devel@nongnu.org; Thu, 11 Sep 2008 14:00:23 -0400 Received: from savannah.gnu.org ([199.232.41.3]:43684 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KdqSs-0007Ey-Er for qemu-devel@nongnu.org; Thu, 11 Sep 2008 14:00:22 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1KdqSr-0006Sw-50 for qemu-devel@nongnu.org; Thu, 11 Sep 2008 18:00:21 +0000 Received: from aliguori by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1KdqSq-0006Sq-NU for qemu-devel@nongnu.org; Thu, 11 Sep 2008 18:00:21 +0000 MIME-Version: 1.0 Errors-To: aliguori Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Anthony Liguori Message-Id: Date: Thu, 11 Sep 2008 18:00:20 +0000 Subject: [Qemu-devel] [5197] Only build compatfd when using AIO and make sure to always init AIO Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 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. Signed-off-by: Anthony Liguori Modified Paths: -------------- trunk/Makefile trunk/Makefile.target trunk/block-raw-posix.c trunk/block.c trunk/configure Modified: trunk/Makefile =================================================================== --- trunk/Makefile 2008-09-11 16:01:02 UTC (rev 5196) +++ trunk/Makefile 2008-09-11 18:00:19 UTC (rev 5197) @@ -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 =================================================================== --- trunk/Makefile.target 2008-09-11 16:01:02 UTC (rev 5196) +++ trunk/Makefile.target 2008-09-11 18:00:19 UTC (rev 5197) @@ -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 =================================================================== --- trunk/block-raw-posix.c 2008-09-11 16:01:02 UTC (rev 5196) +++ trunk/block-raw-posix.c 2008-09-11 18:00:19 UTC (rev 5197) @@ -561,6 +561,9 @@ return; #endif + if (!first_aio) + return; + do { fd_set rdfds; Modified: trunk/block.c =================================================================== --- trunk/block.c 2008-09-11 16:01:02 UTC (rev 5196) +++ trunk/block.c 2008-09-11 18:00:19 UTC (rev 5197) @@ -1328,6 +1328,8 @@ #ifndef _WIN32 bdrv_register(&bdrv_nbd); #endif + + qemu_aio_init(); } void *qemu_aio_get(BlockDriverState *bs, BlockDriverCompletionFunc *cb, Modified: trunk/configure =================================================================== --- trunk/configure 2008-09-11 16:01:02 UTC (rev 5196) +++ trunk/configure 2008-09-11 18:00:19 UTC (rev 5197) @@ -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