aboutsummaryrefslogtreecommitdiff
path: root/block/parallels.c
diff options
context:
space:
mode:
Diffstat (limited to 'block/parallels.c')
-rw-r--r--block/parallels.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/block/parallels.c b/block/parallels.c
index d812210b4f..cce7336cac 100644
--- a/block/parallels.c
+++ b/block/parallels.c
@@ -68,13 +68,15 @@ typedef enum ParallelsPreallocMode {
PRL_PREALLOC_MODE__MAX = 2,
} ParallelsPreallocMode;
-static const char *prealloc_mode_lookup[] = {
- "falloc",
- "truncate",
- NULL,
+static QEnumLookup prealloc_mode_lookup = {
+ .array = (const char *const[]) {
+ "falloc",
+ "truncate",
+ NULL,
+ },
+ .size = PRL_PREALLOC_MODE__MAX
};
-
typedef struct BDRVParallelsState {
/** Locking is conservative, the lock protects
* - image file extending (truncate, fallocate)
@@ -695,7 +697,7 @@ static int parallels_open(BlockDriverState *bs, QDict *options, int flags,
qemu_opt_get_size_del(opts, PARALLELS_OPT_PREALLOC_SIZE, 0);
s->prealloc_size = MAX(s->tracks, s->prealloc_size >> BDRV_SECTOR_BITS);
buf = qemu_opt_get_del(opts, PARALLELS_OPT_PREALLOC_MODE);
- s->prealloc_mode = qapi_enum_parse(prealloc_mode_lookup, buf,
+ s->prealloc_mode = qapi_enum_parse(&prealloc_mode_lookup, buf,
PRL_PREALLOC_MODE_FALLOCATE,
&local_err);
g_free(buf);