提交 e44bd6fc 编写于 作者: S Stefan Weil 提交者: Anthony Liguori

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: NStefan Weil <weil@mail.berlios.de>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 f8274971
......@@ -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
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册