... and both values are the same other QType (QTYPE_QNULL, QTYPE_QNUM,
QTYPE_QSTRING, QTYPE_QBOOL): overwrite.
Why is overwrite restricted to same QType? Is there no need for
overwriting say a string with a number? Hmm, I guess it's okay, because
keyval_parse() only ever produces QTYPE_QSTRING scalars. May be worth a
comment, preferably in a function contract.
However, some users look at*all* pairs. This provides "repeated keys
build up a list" semantics.
Example 4: repeated option key builds a list
$ qemu-system-x86_64 -S -spice
tls-port=12345,tls-channel=main,tls-channel=display
This fails for me because I don't have Spice set up (and know basically
nothing about it), but a working variation of it should configure*two*
channels, not one: the second tls-channel= does*not* overwrite the
first one, it configures another channel.
Since -spice is a merge_lists option, this should be the case for
multiple -spice, too. Merging the two options with keyval_merge() would
not preserve that behavior, I'm afraid.
QemuOpts is... complicated.