diff options
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | Makefile.target | 6 | ||||
-rw-r--r-- | block-raw-posix.c | 3 | ||||
-rw-r--r-- | block.c | 2 | ||||
-rwxr-xr-x | configure | 1 |
5 files changed, 16 insertions, 2 deletions
@@ -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; @@ -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, @@ -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 |