Commit 96518254 authored by Kevin Wolf's avatar Kevin Wolf
Browse files

raw-posix: Deprecate aio=threads fallback without O_DIRECT



Currently, if the user requests aio=native, but forgets to choose a
cache mode that sets O_DIRECT, that request is silently ignored and raw
falls back to aio=threads.

Deprecate that behaviour so we can make it an error in future qemu
versions.

Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
parent 92a539d2
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -503,6 +503,14 @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
        error_setg_errno(errp, -ret, "Could not set AIO state");
        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);
    }
#endif

    s->has_discard = true;