aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2009-08-10 23:39:39 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-08-24 08:46:47 -0500
commit4dd75c702c96ec84db4efe24fcc80a4d7bb32df2 (patch)
tree6161ce5da1c74dc052d08a1d7fafb8d2624bb4fe /block
parent3987e1cf6db2ce530e0b01ae120933b6cca28b90 (diff)
make pthreads mandatory
As requested by Anthony make pthreads mandatory. This means we will always have AIO available on posix hosts, and it will also allow enabling the I/O thread unconditionally once it's ready. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'block')
-rw-r--r--block/raw-posix.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/block/raw-posix.c b/block/raw-posix.c
index bdee07f4c8..ab43589402 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -27,9 +27,7 @@
#include "qemu-log.h"
#include "block_int.h"
#include "module.h"
-#ifdef CONFIG_AIO
#include "posix-aio-compat.h"
-#endif
#ifdef CONFIG_COCOA
#include <paths.h>
@@ -489,7 +487,6 @@ static int raw_write(BlockDriverState *bs, int64_t sector_num,
return ret;
}
-#ifdef CONFIG_AIO
/***********************************************************/
/* Unix AIO using POSIX AIO */
@@ -725,13 +722,6 @@ static BlockDriverAIOCB *raw_aio_writev(BlockDriverState *bs,
}
return &acb->common;
}
-#else /* CONFIG_AIO */
-static int posix_aio_init(void)
-{
- return 0;
-}
-#endif /* CONFIG_AIO */
-
static void raw_close(BlockDriverState *bs)
{
@@ -906,10 +896,8 @@ static BlockDriver bdrv_raw = {
.bdrv_create = raw_create,
.bdrv_flush = raw_flush,
-#ifdef CONFIG_AIO
.bdrv_aio_readv = raw_aio_readv,
.bdrv_aio_writev = raw_aio_writev,
-#endif
.bdrv_truncate = raw_truncate,
.bdrv_getlength = raw_getlength,
@@ -1026,7 +1014,7 @@ static int hdev_open(BlockDriverState *bs, const char *filename, int flags)
#endif
s->type = FTYPE_FILE;
-#if defined(__linux__) && defined(CONFIG_AIO)
+#if defined(__linux__)
if (strstart(filename, "/dev/sg", NULL)) {
bs->sg = 1;
}
@@ -1092,7 +1080,6 @@ static int hdev_ioctl(BlockDriverState *bs, unsigned long int req, void *buf)
return ioctl(s->fd, req, buf);
}
-#ifdef CONFIG_AIO
static BlockDriverAIOCB *hdev_aio_ioctl(BlockDriverState *bs,
unsigned long int req, void *buf,
BlockDriverCompletionFunc *cb, void *opaque)
@@ -1123,7 +1110,6 @@ static BlockDriverAIOCB *hdev_aio_ioctl(BlockDriverState *bs,
return &acb->common;
}
-#endif
#elif defined(__FreeBSD__)
static int fd_open(BlockDriverState *bs)
@@ -1183,10 +1169,8 @@ static BlockDriver bdrv_host_device = {
.bdrv_create = hdev_create,
.bdrv_flush = raw_flush,
-#ifdef CONFIG_AIO
.bdrv_aio_readv = raw_aio_readv,
.bdrv_aio_writev = raw_aio_writev,
-#endif
.bdrv_read = raw_read,
.bdrv_write = raw_write,
@@ -1195,10 +1179,8 @@ static BlockDriver bdrv_host_device = {
/* generic scsi device */
#ifdef __linux__
.bdrv_ioctl = hdev_ioctl,
-#ifdef CONFIG_AIO
.bdrv_aio_ioctl = hdev_aio_ioctl,
#endif
-#endif
};
#ifdef __linux__
@@ -1283,10 +1265,8 @@ static BlockDriver bdrv_host_floppy = {
.bdrv_create = hdev_create,
.bdrv_flush = raw_flush,
-#ifdef CONFIG_AIO
.bdrv_aio_readv = raw_aio_readv,
.bdrv_aio_writev = raw_aio_writev,
-#endif
.bdrv_read = raw_read,
.bdrv_write = raw_write,
@@ -1365,10 +1345,8 @@ static BlockDriver bdrv_host_cdrom = {
.bdrv_create = hdev_create,
.bdrv_flush = raw_flush,
-#ifdef CONFIG_AIO
.bdrv_aio_readv = raw_aio_readv,
.bdrv_aio_writev = raw_aio_writev,
-#endif
.bdrv_read = raw_read,
.bdrv_write = raw_write,
@@ -1381,9 +1359,7 @@ static BlockDriver bdrv_host_cdrom = {
/* generic scsi device */
.bdrv_ioctl = hdev_ioctl,
-#ifdef CONFIG_AIO
.bdrv_aio_ioctl = hdev_aio_ioctl,
-#endif
};
#endif /* __linux__ */
@@ -1488,10 +1464,8 @@ static BlockDriver bdrv_host_cdrom = {
.bdrv_create = hdev_create,
.bdrv_flush = raw_flush,
-#ifdef CONFIG_AIO
.bdrv_aio_readv = raw_aio_readv,
.bdrv_aio_writev = raw_aio_writev,
-#endif
.bdrv_read = raw_read,
.bdrv_write = raw_write,