summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Weil <weil@mail.berlios.de>2009-08-28 14:39:31 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-08-28 08:57:49 -0500
commite44bd6fc15757193d044188213e439ca942dd581 (patch)
treea4604aebfae7d900866a0401ad9ba298089f3669 /block/raw-posix.c
parentFix sb16 breakage due to unassigned s->irq (diff)
downloadqemu-kvm-e44bd6fc15757193d044188213e439ca942dd581.tar.gz
qemu-kvm-e44bd6fc15757193d044188213e439ca942dd581.tar.bz2
qemu-kvm-e44bd6fc15757193d044188213e439ca942dd581.zip
Don't compile aio code if CONFIG_LINUX_AIO is undefined
This patch fixes linker errors when building QEMU without Linux AIO support. It is based on suggestions from malc and Kevin Wolf. Signed-off-by: Stefan Weil <weil@mail.berlios.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'block/raw-posix.c')
-rw-r--r--block/raw-posix.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/block/raw-posix.c b/block/raw-posix.c
index 8a7dc1570..2125d67a5 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -115,7 +115,9 @@ typedef struct BDRVRawState {
int fd_got_error;
int fd_media_changed;
#endif
+#ifdef CONFIG_LINUX_AIO
int use_aio;
+#endif
uint8_t* aligned_buf;
} BDRVRawState;
@@ -183,7 +185,9 @@ static int raw_open_common(BlockDriverState *bs, const char *filename,
if (!s->aio_ctx) {
goto out_free_buf;
}
+#ifdef CONFIG_LINUX_AIO
s->use_aio = 0;
+#endif
}
return 0;
@@ -542,9 +546,11 @@ static BlockDriverAIOCB *raw_aio_submit(BlockDriverState *bs,
if (s->aligned_buf) {
if (!qiov_is_aligned(qiov)) {
type |= QEMU_AIO_MISALIGNED;
+#ifdef CONFIG_LINUX_AIO
} else if (s->use_aio) {
return laio_submit(bs, s->aio_ctx, s->fd, sector_num, qiov,
- nb_sectors, cb, opaque, type);
+ nb_sectors, cb, opaque, type);
+#endif
}
}