[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 05/25] keyval: simplify keyval_parse_one
From: |
Paolo Bonzini |
Subject: |
Re: [PATCH 05/25] keyval: simplify keyval_parse_one |
Date: |
Fri, 22 Jan 2021 16:00:07 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 |
On 22/01/21 14:48, Markus Armbruster wrote:
--nbd .key=
master: Invalid parameter '..key'
your patch: same
Likweise.
If I omit the '=', your patch's message changes to
No implicit parameter name for value 'key..'
I consider that worse than before, because it's talking about
something outside the user's control (lack of an implict parameter
name) where it should instead tell the user what needs fixing in the
input.
I think whether it's better or worse depends on the specific erroneous
command line (think "--nbd /path/to/file.qcow2"), but I can certainly
change it.
Your patch also adds an "Expected parameter at end of string" error.
Can you tell me how to trigger it?
It is meant for "--nbd ''" but it is effectively dead code due to the
"while (*s)" in the caller. Possibilities:
1) leave it in as dead code
2) replace it with an assert
3) change the caller to use a do...while in such a way that it triggers
it (and be careful not to change the grammar).
I believe your grammar is ambiguous. Your code seems to pick the sane
alternative. If I'm wrong, you need to enlighten me. If I'm right, you
need to fix your grammar.
Will do. Can I change the EBNF to use "+" and "*" for simplicity and
clarity?
Hmm, bartering opportunity... May I have your support for me
eliminating anti-social device names in exchange?
I do not mind removing them. What's the barter exactly like? :)
Paolo
- Re: [PATCH 01/25] qemu-option: clean up id vs. list->merge_lists, (continued)
[PATCH 02/25] qemu-option: move help handling to get_opt_name_value, Paolo Bonzini, 2021/01/18
[PATCH 04/25] keyval: accept escaped commas in implied option, Paolo Bonzini, 2021/01/18
[PATCH 05/25] keyval: simplify keyval_parse_one, Paolo Bonzini, 2021/01/18
[PATCH 03/25] qemu-option: warn for short-form boolean options, Paolo Bonzini, 2021/01/18
- Re: [PATCH 03/25] qemu-option: warn for short-form boolean options, Markus Armbruster, 2021/01/19
- Re: [PATCH 03/25] qemu-option: warn for short-form boolean options, Paolo Bonzini, 2021/01/19
- Re: [PATCH 03/25] qemu-option: warn for short-form boolean options, Markus Armbruster, 2021/01/20
- Re: [PATCH 03/25] qemu-option: warn for short-form boolean options, Paolo Bonzini, 2021/01/20
- Re: [PATCH 03/25] qemu-option: warn for short-form boolean options, Markus Armbruster, 2021/01/20
- Re: [PATCH 03/25] qemu-option: warn for short-form boolean options, Paolo Bonzini, 2021/01/20
[PATCH 07/25] keyval: introduce keyval_parse_into, Paolo Bonzini, 2021/01/18