From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: qemu-devel@nongnu.org, kwolf@redhat.com, pkrempa@redhat.com,
mdroth@linux.vnet.ibm.com, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 03/24] keyval: New keyval_parse()
Date: Sun, 05 Mar 2017 11:07:35 +0100 [thread overview]
Message-ID: <87y3wkavfc.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <8760ju561c.fsf@dusky.pond.sub.org> (Markus Armbruster's message of "Tue, 28 Feb 2017 23:01:19 +0100")
Markus Armbruster <armbru@redhat.com> writes:
> Eric Blake <eblake@redhat.com> writes:
>
>> On 02/28/2017 03:26 PM, Markus Armbruster wrote:
>>> keyval_parse() parses KEY=VALUE,... into a QDict. Works like
>>> qemu_opts_parse(), except:
>>>
>>> * Returns a QDict instead of a QemuOpts (d'oh).
>>>
>>> * Supports nesting, unlike QemuOpts: a KEY is split into key
>>> fragments at '.' (dotted key convention; the block layer does
>>> something similar on top of QemuOpts). The key fragments are QDict
>>> keys, and the last one's value is updated to VALUE.
>>>
>>> * Each key fragment may be up to 127 bytes long. qemu_opts_parse()
>>> limits the entire key to 127 bytes.
>>>
>>> * Overlong key fragments are rejected. qemu_opts_parse() silently
>>> truncates them.
>>>
>>> * Empty key fragments are rejected. qemu_opts_parse() happily
>>> accepts empty keys.
>>>
>>> * It does not store the returned value. qemu_opts_parse() stores it
>>> in the QemuOptsList.
>>>
>>> * It does not treat parameter "id" specially. qemu_opts_parse()
>>> ignores all but the first "id", and fails when its value isn't
>>> id_wellformed(), or duplicate (a QemuOpts with the same ID is
>>> already stored). It also screws up when a value contains ",id=".
>>>
>>> * Implied value is not supported. qemu_opts_parse() desugars "foo" to
>>> "foo=on", and "nofoo" to "foo=off".
>>>
>>> * An implied key's value can't be empty, and can't contain ','.
>>
>> or '=' (but the presence of '=' means no implied key, while the presence
>> of ',' marks end of the implied key's value). Not sure it's worth
>> tweaking this commit message any further.
>
> Both fail the assertion they're meant to fail (I tested). I'll fix the
> commit message.
Actually, there is nothing to fix, because there's no difference to
qemu_opts_parse().
Note that the comment in the code documents both ',' and '=', because
it's about keyval_parse(), not its difference to qemu_opts_parse().
>>> I intend to grow this into a saner replacement for QemuOpts. It'll
>>> take time, though.
>>>
>>> Note: keyval_parse() provides no way to do lists, and its key syntax
>>> is incompatible with the __RFQDN_ prefix convention for downstream
>>> extensions, because it blindly splits at '.', even in __RFQDN_. Both
>>> issues will be addressed later in the series.
>>>
>>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>>> ---
>>
>> Looks like you addressed all the comments.
>> Reviewed-by: Eric Blake <eblake@redhat.com>
>
> Thanks!
next prev parent reply other threads:[~2017-03-05 10:07 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-28 21:26 [Qemu-devel] [PATCH v2 00/24] block: Command line option -blockdev Markus Armbruster
2017-02-28 21:26 ` [Qemu-devel] [PATCH v2 01/24] test-qemu-opts: Cover qemu_opts_parse() of "no" Markus Armbruster
2017-02-28 21:26 ` [Qemu-devel] [PATCH v2 02/24] tests: Fix gcov-files-test-qemu-opts-y, gcov-files-test-logging-y Markus Armbruster
2017-02-28 21:26 ` [Qemu-devel] [PATCH v2 03/24] keyval: New keyval_parse() Markus Armbruster
2017-02-28 21:48 ` Eric Blake
2017-02-28 22:01 ` Markus Armbruster
2017-03-05 10:07 ` Markus Armbruster [this message]
2017-02-28 22:03 ` Kevin Wolf
2017-02-28 21:26 ` [Qemu-devel] [PATCH v2 04/24] qapi: qobject input visitor variant for use with keyval_parse() Markus Armbruster
2017-02-28 21:26 ` [Qemu-devel] [PATCH v2 05/24] test-keyval: Cover use with qobject input visitor Markus Armbruster
2017-02-28 21:26 ` [Qemu-devel] [PATCH v2 06/24] qapi: Factor out common part of qobject input visitor creation Markus Armbruster
2017-02-28 21:26 ` [Qemu-devel] [PATCH v2 07/24] qapi: Factor out common qobject_input_get_keyval() Markus Armbruster
2017-02-28 21:26 ` [Qemu-devel] [PATCH v2 08/24] qobject: Propagate parse errors through qobject_from_jsonv() Markus Armbruster
2017-02-28 21:26 ` [Qemu-devel] [PATCH v2 09/24] libqtest: Fix qmp() & friends to abort on JSON parse errors Markus Armbruster
2017-02-28 21:26 ` [Qemu-devel] [PATCH v2 10/24] qjson: Abort earlier on qobject_from_jsonf() misuse Markus Armbruster
2017-02-28 21:26 ` [Qemu-devel] [PATCH v2 11/24] test-qobject-input-visitor: Abort earlier on bad test input Markus Armbruster
2017-02-28 21:26 ` [Qemu-devel] [PATCH v2 12/24] qobject: Propagate parse errors through qobject_from_json() Markus Armbruster
2017-02-28 21:26 ` [Qemu-devel] [PATCH v2 13/24] block: More detailed syntax error reporting for JSON filenames Markus Armbruster
2017-02-28 21:27 ` [Qemu-devel] [PATCH v2 14/24] check-qjson: Test errors from qobject_from_json() Markus Armbruster
2017-02-28 21:27 ` [Qemu-devel] [PATCH v2 15/24] test-visitor-serialization: Pass &error_abort to qobject_from_json() Markus Armbruster
2017-02-28 21:27 ` [Qemu-devel] [PATCH v2 16/24] monitor: Assert qmp_schema_json[] is sane Markus Armbruster
2017-02-28 21:27 ` [Qemu-devel] [PATCH v2 17/24] test-qapi-util: New, covering qapi/qapi-util.c Markus Armbruster
2017-02-28 21:27 ` [Qemu-devel] [PATCH v2 18/24] qapi: New parse_qapi_name() Markus Armbruster
2017-02-28 22:04 ` Kevin Wolf
2017-02-28 21:27 ` [Qemu-devel] [PATCH v2 19/24] keyval: Restrict key components to valid QAPI names Markus Armbruster
2017-02-28 21:27 ` [Qemu-devel] [PATCH v2 20/24] qapi: New qobject_input_visitor_new_str() for convenience Markus Armbruster
2017-02-28 22:05 ` Kevin Wolf
2017-02-28 21:27 ` [Qemu-devel] [PATCH v2 21/24] block: Initial implementation of -blockdev Markus Armbruster
2017-02-28 22:05 ` Kevin Wolf
2017-02-28 21:27 ` [Qemu-devel] [PATCH v2 22/24] qapi: Improve how keyval input visitor reports unexpected dicts Markus Armbruster
2017-02-28 21:27 ` [Qemu-devel] [PATCH v2 23/24] docs/qapi-code-gen.txt: Clarify naming rules Markus Armbruster
2017-02-28 21:27 ` [Qemu-devel] [PATCH v2 24/24] keyval: Support lists Markus Armbruster
2017-02-28 22:02 ` Kevin Wolf
2017-02-28 22:11 ` Markus Armbruster
2017-02-28 22:17 ` Kevin Wolf
2017-02-28 22:56 ` Eric Blake
2017-03-01 5:47 ` Markus Armbruster
2017-02-28 21:55 ` [Qemu-devel] [PATCH v2 00/24] block: Command line option -blockdev Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y3wkavfc.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=pkrempa@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.