diff options
Diffstat (limited to 'block/file-posix.c')
-rw-r--r-- | block/file-posix.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/block/file-posix.c b/block/file-posix.c index cb3bfce147..6acbd56238 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -31,7 +31,6 @@ #include "block/thread-pool.h" #include "qemu/iov.h" #include "block/raw-aio.h" -#include "qapi/util.h" #include "qapi/qmp/qstring.h" #if defined(__APPLE__) && (__MACH__) @@ -438,8 +437,9 @@ static int raw_open_common(BlockDriverState *bs, QDict *options, aio_default = (bdrv_flags & BDRV_O_NATIVE_AIO) ? BLOCKDEV_AIO_OPTIONS_NATIVE : BLOCKDEV_AIO_OPTIONS_THREADS; - aio = qapi_enum_parse(BlockdevAioOptions_lookup, qemu_opt_get(opts, "aio"), - BLOCKDEV_AIO_OPTIONS__MAX, aio_default, &local_err); + aio = qapi_enum_parse(&BlockdevAioOptions_lookup, + qemu_opt_get(opts, "aio"), + aio_default, &local_err); if (local_err) { error_propagate(errp, local_err); ret = -EINVAL; @@ -447,8 +447,9 @@ static int raw_open_common(BlockDriverState *bs, QDict *options, } s->use_linux_aio = (aio == BLOCKDEV_AIO_OPTIONS_NATIVE); - locking = qapi_enum_parse(OnOffAuto_lookup, qemu_opt_get(opts, "locking"), - ON_OFF_AUTO__MAX, ON_OFF_AUTO_AUTO, &local_err); + locking = qapi_enum_parse(&OnOffAuto_lookup, + qemu_opt_get(opts, "locking"), + ON_OFF_AUTO_AUTO, &local_err); if (local_err) { error_propagate(errp, local_err); ret = -EINVAL; @@ -1725,7 +1726,7 @@ static int raw_regular_truncate(int fd, int64_t offset, PreallocMode prealloc, default: result = -ENOTSUP; error_setg(errp, "Unsupported preallocation mode: %s", - PreallocMode_lookup[prealloc]); + PreallocMode_str(prealloc)); return result; } @@ -1760,7 +1761,7 @@ static int raw_truncate(BlockDriverState *bs, int64_t offset, if (prealloc != PREALLOC_MODE_OFF) { error_setg(errp, "Preallocation mode '%s' unsupported for this " - "non-regular file", PreallocMode_lookup[prealloc]); + "non-regular file", PreallocMode_str(prealloc)); return -ENOTSUP; } @@ -1974,9 +1975,8 @@ static int raw_create(const char *filename, QemuOpts *opts, Error **errp) BDRV_SECTOR_SIZE); nocow = qemu_opt_get_bool(opts, BLOCK_OPT_NOCOW, false); buf = qemu_opt_get_del(opts, BLOCK_OPT_PREALLOC); - prealloc = qapi_enum_parse(PreallocMode_lookup, buf, - PREALLOC_MODE__MAX, PREALLOC_MODE_OFF, - &local_err); + prealloc = qapi_enum_parse(&PreallocMode_lookup, buf, + PREALLOC_MODE_OFF, &local_err); g_free(buf); if (local_err) { error_propagate(errp, local_err); |