mirror of https://github.com/xemu-project/xemu.git
raw-posix: Always check paio_init result
Signed-off-by: Frediano Ziglio <freddy77@gmail.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
c1ee7d56f3
commit
f6e8ffc22f
|
@ -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
|
#ifdef CONFIG_LINUX_AIO
|
||||||
if ((bdrv_flags & (BDRV_O_NOCACHE|BDRV_O_NATIVE_AIO)) ==
|
if ((bdrv_flags & (BDRV_O_NOCACHE|BDRV_O_NATIVE_AIO)) ==
|
||||||
(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();
|
s->aio_ctx = laio_init();
|
||||||
if (!s->aio_ctx) {
|
if (!s->aio_ctx) {
|
||||||
goto out_free_buf;
|
goto out_free_buf;
|
||||||
|
@ -245,9 +247,6 @@ static int raw_open_common(BlockDriverState *bs, const char *filename,
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
if (paio_init() < 0) {
|
|
||||||
goto out_free_buf;
|
|
||||||
}
|
|
||||||
#ifdef CONFIG_LINUX_AIO
|
#ifdef CONFIG_LINUX_AIO
|
||||||
s->use_aio = 0;
|
s->use_aio = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue