qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [RFC PATCH 08/10] util: Add qemu_opts_to_qdict_filtered


From: Eric Blake
Subject: Re: [Qemu-block] [RFC PATCH 08/10] util: Add qemu_opts_to_qdict_filtered()
Date: Tue, 16 Jan 2018 13:45:34 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

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 <address@hidden>
> ---
>  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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]