[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
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-block] [RFC PATCH 04/10] qcow2: Pass BlockdevCreateOptions to qcow2_create2(), (continued)
- [Qemu-block] [RFC PATCH 05/10] qcow2: Use BlockdevRef in qcow2_create2(), Kevin Wolf, 2018/01/11
- [Qemu-block] [RFC PATCH 06/10] qcow2: Use QCryptoBlockCreateOptions in qcow2_create2(), Kevin Wolf, 2018/01/11
- [Qemu-block] [RFC PATCH 07/10] qcow2: Handle full/falloc preallocation in qcow2_create2(), Kevin Wolf, 2018/01/11
- [Qemu-block] [RFC PATCH 08/10] util: Add qemu_opts_to_qdict_filtered(), Kevin Wolf, 2018/01/11
- Re: [Qemu-block] [RFC PATCH 08/10] util: Add qemu_opts_to_qdict_filtered(),
Eric Blake <=
- [Qemu-block] [RFC PATCH 09/10] qcow2: Use visitor for options in qcow2_create(), Kevin Wolf, 2018/01/11
- [Qemu-block] [RFC PATCH 10/10] block: x-blockdev-create QMP command, Kevin Wolf, 2018/01/11
- Re: [Qemu-block] [Qemu-devel] [RFC PATCH 00/10] x-blockdev-create for qcow2, no-reply, 2018/01/11
- Re: [Qemu-block] [Qemu-devel] [RFC PATCH 00/10] x-blockdev-create for qcow2, no-reply, 2018/01/11
- Re: [Qemu-block] [RFC PATCH 00/10] x-blockdev-create for qcow2, Kevin Wolf, 2018/01/16
- Re: [Qemu-block] [RFC PATCH 00/10] x-blockdev-create for qcow2, Max Reitz, 2018/01/29