summaryrefslogtreecommitdiff
path: root/block/raw-posix.c
diff options
context:
space:
mode:
authorFrediano Ziglio <freddy77@gmail.com>2011-07-27 20:12:02 +0200
committerKevin Wolf <kwolf@redhat.com>2011-08-01 12:10:29 +0200
commitf6e8ffc22fe153ba981f2747e4c52ea7e55f6ecc (patch)
tree982cf9188ea6b9b2cb67e2975a8fafce7d5348a4 /block/raw-posix.c
parentc1ee7d56f3f2c8c5fb90452f4df72fa402f61527 (diff)
raw-posix: Always check paio_init result
Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/raw-posix.c')
-rw-r--r--block/raw-posix.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/block/raw-posix.c b/block/raw-posix.c
index 6dd708688..c5c99446c 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -230,13 +230,15 @@ static int raw_open_common(BlockDriverState *bs, const char *filename,
}
}
+ /* We're falling back to POSIX AIO in some cases so init always */
+ if (paio_init() < 0) {
+ goto out_free_buf;
+ }
+
#ifdef CONFIG_LINUX_AIO
if ((bdrv_flags & (BDRV_O_NOCACHE|BDRV_O_NATIVE_AIO)) ==
(BDRV_O_NOCACHE|BDRV_O_NATIVE_AIO)) {
- /* We're falling back to POSIX AIO in some cases */
- paio_init();
-
s->aio_ctx = laio_init();
if (!s->aio_ctx) {
goto out_free_buf;
@@ -245,9 +247,6 @@ static int raw_open_common(BlockDriverState *bs, const char *filename,
} else
#endif
{
- if (paio_init() < 0) {
- goto out_free_buf;
- }
#ifdef CONFIG_LINUX_AIO
s->use_aio = 0;
#endif