Alberto Garcia <be...@igalia.com> writes: > On Tue 22 Aug 2017 03:22:12 PM CEST, Marc-André Lureau wrote: > >> @@ -925,7 +908,13 @@ static int quorum_open(BlockDriverState *bs, QDict >> *options, int flags, >> goto exit; >> } >> >> - ret = parse_read_pattern(qemu_opt_get(opts, QUORUM_OPT_READ_PATTERN)); >> + if (!qemu_opt_get(opts, QUORUM_OPT_READ_PATTERN)) { >> + ret = QUORUM_READ_PATTERN_QUORUM; >> + } else { >> + ret = qapi_enum_parse(QuorumReadPattern_lookup, >> + qemu_opt_get(opts, QUORUM_OPT_READ_PATTERN), >> + QUORUM_READ_PATTERN__MAX, -EINVAL, NULL); >> + } > > I don't like so much that you call qemu_opt_get() twice with the same > parameters,
Easy enough to avoid. > but else the change makes sense. Is that an R-by? R-by if qemu_opt_get() is called just once?