summaryrefslogtreecommitdiff
path: root/block/qcow2.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2017-08-24 10:45:57 +0200
committerMarkus Armbruster <armbru@redhat.com>2017-09-04 13:09:13 +0200
commit06c60b6c468ca7cde004fe7c3ce35de312855f55 (patch)
tree33e164badc15e320421ba47f5a26a622f4d85dee /block/qcow2.c
parent64355088e0213b564eb6ef5d2658210accfcc32f (diff)
downloadqemu-06c60b6c468ca7cde004fe7c3ce35de312855f55.zip
qapi: Drop superfluous qapi_enum_parse() parameter max
The lookup tables have a sentinel, no need to make callers pass their size. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1503564371-26090-3-git-send-email-armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Rebased, commit message corrected]
Diffstat (limited to 'block/qcow2.c')
-rw-r--r--block/qcow2.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index a3679c69e8..470a0dedaa 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -2917,8 +2917,7 @@ static int qcow2_create(const char *filename, QemuOpts *opts, Error **errp)
}
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_MODE_OFF, &local_err);
if (local_err) {
error_propagate(errp, local_err);
ret = -EINVAL;
@@ -3608,8 +3607,7 @@ static BlockMeasureInfo *qcow2_measure(QemuOpts *opts, BlockDriverState *in_bs,
optstr = qemu_opt_get_del(opts, BLOCK_OPT_PREALLOC);
prealloc = qapi_enum_parse(PreallocMode_lookup, optstr,
- PREALLOC_MODE__MAX, PREALLOC_MODE_OFF,
- &local_err);
+ PREALLOC_MODE_OFF, &local_err);
g_free(optstr);
if (local_err) {
goto err;