diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-05-24 18:03:13 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2012-10-31 10:38:12 +0100 |
commit | 47e6b251a5e9a47c406f2f2c0b01bb88854c98ec (patch) | |
tree | 9c254f62be2c7e696f5831a557899dbdc4e16d54 /block | |
parent | 19d092cf9ba3c01b0e22ef65c499ae7ddc28d0e8 (diff) |
block: switch posix-aio-compat to threadpool
This is not meant for portability, but to remove code duplication.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/raw-posix-aio.h | 1 | ||||
-rw-r--r-- | block/raw-posix.c | 12 |
2 files changed, 2 insertions, 11 deletions
diff --git a/block/raw-posix-aio.h b/block/raw-posix-aio.h index ba118f616b..6725135dd4 100644 --- a/block/raw-posix-aio.h +++ b/block/raw-posix-aio.h @@ -28,7 +28,6 @@ /* posix-aio-compat.c - thread pool based implementation */ -int paio_init(void); BlockDriverAIOCB *paio_submit(BlockDriverState *bs, int fd, int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, BlockDriverCompletionFunc *cb, void *opaque, int type); diff --git a/block/raw-posix.c b/block/raw-posix.c index 28d439fa81..9ae2c505a8 100644 --- a/block/raw-posix.c +++ b/block/raw-posix.c @@ -266,14 +266,10 @@ static int raw_open_common(BlockDriverState *bs, const char *filename, } s->fd = fd; - /* We're falling back to POSIX AIO in some cases so init always */ - if (paio_init() < 0) { - goto out_close; - } - #ifdef CONFIG_LINUX_AIO if (raw_set_aio(&s->aio_ctx, &s->use_aio, bdrv_flags)) { - goto out_close; + qemu_close(fd); + return -errno; } #endif @@ -284,10 +280,6 @@ static int raw_open_common(BlockDriverState *bs, const char *filename, #endif return 0; - -out_close: - qemu_close(fd); - return -errno; } static int raw_open(BlockDriverState *bs, const char *filename, int flags) |