block: Fix build
PATCH 1/1 block: Fix build
Current build is broken because laio_submit() is only available if the host has Linux AIO support, otherwise we will get the following build error:
"""block/raw-posix.o: In function `raw_aio_submit':qemu-qmp/block/raw-posix.c:546: undefined reference to `laio_submit'
collect2: ld returned 1 exit status
"""
Signed-off-by Luiz Capitulino <[email protected]>
---
PS: Hope this is right, only compiled tested.
block/raw-posix.c +4 -1
@@ -542,10 +542,13 @@ static BlockDriverAIOCB *raw_aio_submit(BlockDriverState *bs,if (s->aligned_buf) {if (!qiov_is_aligned (qiov)) { type |=QEMU_AIO_MISALIGNED ; - }else if (s->use_aio) { + } +#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); } +#endif } return paio_submit(bs, s->aio_ctx, s->fd, sector_num, qiov, nb_sectors,
Quoted 10 lines · Luiz Capitulino
Current build is broken because
laio_submit()is only available if the host has Linux AIO support, otherwise we will get the following build error:"""
block/raw-posix.o: In function `raw_aio_submit':qemu-qmp/block/raw-posix.c:546: undefined reference to `laio_submit'
collect2: ld returned 1 exit status
"""
looks good. Sorry, I had this working and changed it last minute.