[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH RFC v3 for-2.9 06/11] rbd: Clean up runtime_opts
Re: [Qemu-devel] [PATCH RFC v3 for-2.9 06/11] rbd: Clean up runtime_opts, fix -drive to reject filename
Mon, 27 Mar 2017 18:38:32 +0200
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 27.03.2017 15:26, Markus Armbruster wrote:
> runtime_opts is used for three different purposes:
> * qemu_rbd_open() uses it to accept options it recognizes, such as
> "pool" and "image". Other .bdrv_open() methods do it similarly.
> * qemu_rbd_open() accepts additional list-valued options
> auth-supported and server, with the help of qemu_rbd_array_opts().
> The list elements are again dictionaries. qemu_rbd_array_opts()
> uses runtime_opts to accept their members. Thus, runtime_opts
> contains recognized sub-sub-options "auth", "host", "port" in
> addition to recognized options. No other block driver does that.
> * qemu_rbd_create() uses it to convert the QDict produced by
> qemu_rbd_parse_filename() to QemuOpts. No other block driver does
> that. The keys produced by qemu_rbd_parse_filename() are "pool",
> "image", "snapshot", "conf", "user" and "keyvalue-pairs".
> qemu_rbd_open() accepts these, so no additional ones here.
> This is a confusing mess. Dates back to commit 0f9d252. First step
> to clean it up is documenting runtime_opts.desc:
> * Reorder entries to match the QAPI schema, like we do in other block
> * Document why the schema's "server" and "auth-supported" aren't in
> * Document why "keyvalue-pairs", "host", "port" and "auth" are in
> .desc, but not the schema.
> * Delete "filename", because none of the three users actually uses it.
> This fixes -drive to reject parameter filename instead of silently
> ignoring it.
> Signed-off-by: Markus Armbruster <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
> block/rbd.c | 40 +++++++++++++++++++++++++---------------
> 1 file changed, 25 insertions(+), 15 deletions(-)
Reviewed-by: Max Reitz <address@hidden>
Description: OpenPGP digital signature