Skip to contentSkip to conversation

block: Fix build

PATCH In review Luiz Capitulino 2 participants 2 messages Aug 28, 2009 Block layer

lore
Share & tools
lore
#0 lore raw

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
"""

---
PS: Hope this is right, only compiled tested.

block/raw-posix.c +4 -1
index 8a7dc15..b5f03d6 100644
@@ -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,
#1 lore raw
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.