raw-posix: Make aio=native option binding

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 96518254
(qemu 2.3; error during init) and commit 1501ecc1 (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 <kwolf@redhat.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Kevin Wolf 2015-12-15 11:35:36 +01:00
parent b1fc8f934b
commit d657c0c289

View file

@ -500,21 +500,17 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
goto fail; goto fail;
} }
if (!s->use_aio && (bdrv_flags & BDRV_O_NATIVE_AIO)) { if (!s->use_aio && (bdrv_flags & BDRV_O_NATIVE_AIO)) {
error_printf("WARNING: aio=native was specified for '%s', but " error_setg(errp, "aio=native was specified, but it requires "
"it requires cache.direct=on, which was not " "cache.direct=on, which was not specified.");
"specified. Falling back to aio=threads.\n" ret = -EINVAL;
" This will become an error condition in " goto fail;
"future QEMU versions.\n",
bs->filename);
} }
#else #else
if (bdrv_flags & BDRV_O_NATIVE_AIO) { if (bdrv_flags & BDRV_O_NATIVE_AIO) {
error_printf("WARNING: aio=native was specified for '%s', but " error_setg(errp, "aio=native was specified, but is not supported "
"is not supported in this build. Falling back to " "in this build.");
"aio=threads.\n" ret = -EINVAL;
" This will become an error condition in " goto fail;
"future QEMU versions.\n",
bs->filename);
} }
#endif /* !defined(CONFIG_LINUX_AIO) */ #endif /* !defined(CONFIG_LINUX_AIO) */