Commit 8185d2c9a20975114ebb59b0f46b615cbb83c730

Authored by aliguori
1 parent 59030a8c

Fix the build for --disable-aio

This was reported by malc.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6993 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 6 additions and 0 deletions
block-raw-posix.c
@@ -1018,8 +1018,10 @@ static int hdev_open(BlockDriverState *bs, const char *filename, int flags) @@ -1018,8 +1018,10 @@ static int hdev_open(BlockDriverState *bs, const char *filename, int flags)
1018 s->fd_open_flags = open_flags; 1018 s->fd_open_flags = open_flags;
1019 /* open will not fail even if no floppy is inserted */ 1019 /* open will not fail even if no floppy is inserted */
1020 open_flags |= O_NONBLOCK; 1020 open_flags |= O_NONBLOCK;
  1021 +#ifdef CONFIG_AIO
1021 } else if (strstart(filename, "/dev/sg", NULL)) { 1022 } else if (strstart(filename, "/dev/sg", NULL)) {
1022 bs->sg = 1; 1023 bs->sg = 1;
  1024 +#endif
1023 } 1025 }
1024 #endif 1026 #endif
1025 #if defined(__FreeBSD__) 1027 #if defined(__FreeBSD__)
@@ -1210,6 +1212,7 @@ static int raw_ioctl(BlockDriverState *bs, unsigned long int req, void *buf) @@ -1210,6 +1212,7 @@ static int raw_ioctl(BlockDriverState *bs, unsigned long int req, void *buf)
1210 return ioctl(s->fd, req, buf); 1212 return ioctl(s->fd, req, buf);
1211 } 1213 }
1212 1214
  1215 +#ifdef CONFIG_AIO
1213 static BlockDriverAIOCB *raw_aio_ioctl(BlockDriverState *bs, 1216 static BlockDriverAIOCB *raw_aio_ioctl(BlockDriverState *bs,
1214 unsigned long int req, void *buf, 1217 unsigned long int req, void *buf,
1215 BlockDriverCompletionFunc *cb, void *opaque) 1218 BlockDriverCompletionFunc *cb, void *opaque)
@@ -1228,6 +1231,7 @@ static BlockDriverAIOCB *raw_aio_ioctl(BlockDriverState *bs, @@ -1228,6 +1231,7 @@ static BlockDriverAIOCB *raw_aio_ioctl(BlockDriverState *bs,
1228 1231
1229 return &acb->common; 1232 return &acb->common;
1230 } 1233 }
  1234 +#endif
1231 1235
1232 #elif defined(__FreeBSD__) 1236 #elif defined(__FreeBSD__)
1233 1237
@@ -1439,5 +1443,7 @@ BlockDriver bdrv_host_device = { @@ -1439,5 +1443,7 @@ BlockDriver bdrv_host_device = {
1439 .bdrv_set_locked = raw_set_locked, 1443 .bdrv_set_locked = raw_set_locked,
1440 /* generic scsi device */ 1444 /* generic scsi device */
1441 .bdrv_ioctl = raw_ioctl, 1445 .bdrv_ioctl = raw_ioctl,
  1446 +#ifdef CONFIG_AIO
1442 .bdrv_aio_ioctl = raw_aio_ioctl, 1447 .bdrv_aio_ioctl = raw_aio_ioctl,
  1448 +#endif
1443 }; 1449 };