Skip to content

Commit

Permalink
raw-posix: warn about BDRV_O_NATIVE_AIO if libaio is unavailable
Browse files Browse the repository at this point in the history
raw-posix.c silently ignores BDRV_O_NATIVE_AIO if libaio is unavailable.
It is confusing when aio=native performance is identical to aio=threads
because the binary was accidentally built without libaio.

Print a deprecation warning if -drive aio=native is used with a binary
that does not support libaio.  There are probably users using aio=native
who would be inconvenienced if QEMU suddenly refused to start their
guests.  In the future this will become an error.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
stefanhaRH authored and kevmw committed Oct 16, 2015
1 parent 15489c7 commit 1501ecc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion block/raw-posix.c
Expand Up @@ -519,7 +519,16 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
"future QEMU versions.\n",
bs->filename);
}
#endif
#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);
}
#endif /* !defined(CONFIG_LINUX_AIO) */

s->has_discard = true;
s->has_write_zeroes = true;
Expand Down

0 comments on commit 1501ecc

Please sign in to comment.