On 01/11/2018 01:52 PM, Kevin Wolf wrote: > This allows, given a QemuOpts for a QemuOptsList that was merged from > multiple QemuOptsList, to only consider those options that exist in one > specific list. Block drivers need this to separate format-layer create > options from protocol-level options.
Someday it would be nice to not have to rely so much on QemuOpts. But in the meantime, this glue makes sense. > > Signed-off-by: Kevin Wolf <kw...@redhat.com> > --- > include/qemu/option.h | 2 ++ > util/qemu-option.c | 28 +++++++++++++++++++++++++--- > 2 files changed, 27 insertions(+), 3 deletions(-) > It would be nice to add direct testsuite coverage of the new function, in addition to the indirect coverage it gets when list is NULL. > +++ b/util/qemu-option.c > @@ -1009,9 +1009,10 @@ void qemu_opts_absorb_qdict(QemuOpts *opts, QDict > *qdict, Error **errp) > * TODO We'll want to use types appropriate for opt->desc->type, but > * this is enough for now. > */ Does this comment need any tweaking... > -QDict *qemu_opts_to_qdict(QemuOpts *opts, QDict *qdict) > +QDict *qemu_opts_to_qdict_filtered(QemuOpts *opts, QDict *qdict, > + QemuOptsList *list, bool del) > { > - QemuOpt *opt; > + QemuOpt *opt, *next; > > if (!qdict) { > qdict = qdict_new(); > > +QDict *qemu_opts_to_qdict(QemuOpts *opts, QDict *qdict) ...or this moved declaration need a comment? > +{ > + return qemu_opts_to_qdict_filtered(opts, qdict, NULL, false); > +} > + > /* Validate parsed opts against descriptions where no > * descriptions were provided in the QemuOptsList. > */ > -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature