Skip to content

Commit

Permalink
raw-posix: Make aio=native option binding
Browse files Browse the repository at this point in the history
Traditionally, aio=native was treated as an advice that could simply be
ignored if an error occurs while initialising Linux AIO or the feature
wasn't compiled in. This behaviour was deprecated in commit 9651825
(qemu 2.3; error during init) and commit 1501ecc (qemu 2.5; not
compiled in).

This patch changes raw-posix to error out in these cases instead of
printing a deprecation warning.

Signed-off-by: Kevin Wolf <[email protected]>
Acked-by: Christian Borntraeger <[email protected]>
Reviewed-by: Stefan Hajnoczi <[email protected]>
  • Loading branch information
kevmw committed Dec 18, 2015
1 parent b1fc8f9 commit d657c0c
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions block/raw-posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,21 +500,17 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
goto fail;
}
if (!s->use_aio && (bdrv_flags & BDRV_O_NATIVE_AIO)) {
error_printf("WARNING: aio=native was specified for '%s', but "
"it requires cache.direct=on, which was not "
"specified. Falling back to aio=threads.\n"
" This will become an error condition in "
"future QEMU versions.\n",
bs->filename);
error_setg(errp, "aio=native was specified, but it requires "
"cache.direct=on, which was not specified.");
ret = -EINVAL;
goto fail;
}
#else
if (bdrv_flags & BDRV_O_NATIVE_AIO) {
error_printf("WARNING: aio=native was specified for '%s', but "
"is not supported in this build. Falling back to "
"aio=threads.\n"
" This will become an error condition in "
"future QEMU versions.\n",
bs->filename);
error_setg(errp, "aio=native was specified, but is not supported "
"in this build.");
ret = -EINVAL;
goto fail;
}
#endif /* !defined(CONFIG_LINUX_AIO) */

Expand Down

0 comments on commit d657c0c

Please sign in to comment.