diff options
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -846,6 +846,28 @@ static BlockdevDetectZeroesOptions bdrv_parse_detect_zeroes(QemuOpts *opts, } /** + * Set open flags for aio engine + * + * Return 0 on success, -1 if the engine specified is invalid + */ +int bdrv_parse_aio(const char *mode, int *flags) +{ + if (!strcmp(mode, "threads")) { + /* do nothing, default */ + } else if (!strcmp(mode, "native")) { + *flags |= BDRV_O_NATIVE_AIO; +#ifdef CONFIG_LINUX_IO_URING + } else if (!strcmp(mode, "io_uring")) { + *flags |= BDRV_O_IO_URING; +#endif + } else { + return -1; + } + + return 0; +} + +/** * Set open flags for a given discard mode * * Return 0 on success, -1 if the discard mode was invalid. |