qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [5197] Only build compatfd when using AIO and make sure to


From: Anthony Liguori
Subject: [Qemu-devel] [5197] Only build compatfd when using AIO and make sure to always init AIO
Date: Thu, 11 Sep 2008 18:00:20 +0000

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 <address@hidden>

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]