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>
This commit is contained in:
Paolo Bonzini 2012-05-24 18:03:13 +02:00
parent 19d092cf9b
commit 47e6b251a5
3 changed files with 40 additions and 398 deletions

View file

@ -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)