From: Markus Armbruster <armbru@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: "Daniel P. Berrange" <berrange@redhat.com>,
Kevin Wolf <kwolf@redhat.com>, Peter Krempa <pkrempa@redhat.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [Qemu-devel] Non-flat command line option argument syntax
Date: Fri, 24 Feb 2017 20:15:23 +0100 [thread overview]
Message-ID: <87bmtr2yes.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <2a42e86c-7c21-4a1b-067d-f842533593a3@redhat.com> (Eric Blake's message of "Fri, 24 Feb 2017 11:17:33 -0600")
Eric Blake <eblake@redhat.com> writes:
> On 02/24/2017 10:39 AM, Daniel P. Berrange wrote:
>> On Fri, Feb 24, 2017 at 05:04:34PM +0100, Markus Armbruster wrote:
>>> Markus Armbruster <armbru@redhat.com> writes:
>>>
>>> [...]
>>>> === Dotted keys ===
>>>>
>>>> One sufficiently powerful syntax extension already exists: the dotted
>>>> key convention. It's syntactically unambiguous only when none of the
>>>> KEYs involved contains '.' To adopt it across the board, we'd have to
>>>> outlaw '.' in KEYs. QAPI outlaws '.' already,
>>>
>>> *Except* in __RFQDN_ prefixes.
>>>
>
>>> Possible solutions:
>>>
>>> (a) Outlaw domain names with '_'. If KEY starts with "__", everything
>>> up to the third '_' is an __RFQDN_ prefix.
>
> While there ARE valid DNS names with _ (such as
> _http._sctp.www.example.com mentioned on
> https://en.wikipedia.org/wiki/Hostname), we are at least told by RFC 952
> that _ is not valid in hostnames. Note that '-' is permitted, and that
> transliterates to '_', so from the flattened name used in C code it's
> harder to tell what is meant, but from the QMP side, I think we are
> guaranteed that no RFQDN will confuse us with any extra _.
DNS registrars may fail to enforce the hostname rules. But we can
specify that only __RFQDN_ prefixes derived from conforming hostnames
are allowed. If someone breaks dotted keys by insisting on deriving his
from a non-conforming hostname, they get to keep the pieces.
We better clarify qapi-code-gen.txt, though.
>>>
>>> (b) Outlaw '_' in the name part that follows __RFQDN_. If KEY starts
>>> with "__", everything up to the last '_' is an __RFQDN_ prefix.
>
> Reasonable enough, since we ask new interfaces to use '-' rather than
> '_'. But does break existing vendors (a quick grep of RHEL 7.3
> downstream finds at least:
>
> qapi-schema.json:{ 'command': '__com.redhat_qxl_screendump', 'data': {
> 'id' : 'str',
>
> So we'd have to get downstream buy-in to this plan, and downstreams may
> have to hack around our new restrictions for a while.
>
>>>
>>> (c) Your bright idea.
>>
>> Define a new downstream vendor naming convention. IMHO it is reasonable
>> to argue that the downstream vendor extensions are outside the scope of
>> backwards compatibility guarantees we normally apply for our CLI args.
>>
>> Thus, simply say that vendors must replace all '.' with _ in their
>> namespace prefix. eg They should use '__com_example_medium.rare=on'
>> which would mean a property '__com_example_medium' which is a struct
>> containing a property rare with value on
Certainly simpler, and arguably what we should've done back when we
created the convention for QMP. But changing it now would be a pain.
> Same argument as (b) - we'd have to get downstream buy-in (and in this
> case, it affects even more cases: ALL downstream extensions have to be
> changed, rather than just the ones using _ after the __RFQDN_ portion).
> But has the slightly nice appeal of avoiding the '.' vs. '_'
> transliteration confusion that catches us only on downstream extensions
> (it's hard to special-case '.' as being permitted in QAPI, but only for
> downstream, because we can easily forget to test it).
>
> If we are happy with the change forced on downstream vendors, I'm okay
> with (c); if not, I think (a) is safe.
Looks like (a) is the least painful. I'll give it a try.
next prev parent reply other threads:[~2017-02-24 19:15 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-02 19:42 [Qemu-devel] Non-flat command line option argument syntax Markus Armbruster
2017-02-02 20:06 ` Eric Blake
2017-02-02 20:23 ` Eric Blake
2017-02-03 7:57 ` Markus Armbruster
2017-02-02 20:27 ` Dr. David Alan Gilbert
2017-02-03 7:50 ` Markus Armbruster
2017-02-03 16:57 ` Dr. David Alan Gilbert
2017-02-04 9:44 ` Markus Armbruster
2017-02-06 10:20 ` Dr. David Alan Gilbert
2017-02-03 20:02 ` [Qemu-devel] [Qemu-block] " Max Reitz
2017-02-04 9:45 ` Markus Armbruster
2017-02-04 10:03 ` [Qemu-devel] " Paolo Bonzini
2017-02-04 11:52 ` Markus Armbruster
2017-02-04 12:43 ` Paolo Bonzini
2017-02-03 10:03 ` Daniel P. Berrange
2017-02-03 11:13 ` Markus Armbruster
2017-02-03 12:37 ` Peter Krempa
2017-02-03 13:53 ` Markus Armbruster
2017-02-03 17:25 ` Richard W.M. Jones
2017-02-04 9:51 ` Markus Armbruster
2017-02-05 20:46 ` [Qemu-devel] [Qemu-block] " Max Reitz
2017-02-03 20:28 ` Max Reitz
2017-02-04 9:56 ` Markus Armbruster
2017-02-04 12:21 ` [Qemu-devel] " Fam Zheng
2017-02-04 12:44 ` Paolo Bonzini
2017-02-04 13:02 ` Fam Zheng
2017-02-04 13:35 ` Markus Armbruster
2017-02-04 14:10 ` Fam Zheng
2017-02-06 6:24 ` Markus Armbruster
2017-02-06 11:08 ` Daniel P. Berrange
2017-02-06 6:57 ` Markus Armbruster
2017-02-06 13:23 ` Kevin Wolf
2017-02-06 15:36 ` Markus Armbruster
2017-02-06 16:33 ` Daniel P. Berrange
2017-02-06 17:24 ` Markus Armbruster
2017-02-06 17:50 ` Daniel P. Berrange
2017-02-06 18:56 ` Markus Armbruster
2017-02-06 17:38 ` Paolo Bonzini
2017-02-06 18:12 ` Markus Armbruster
2017-02-06 21:52 ` Paolo Bonzini
2017-02-07 7:02 ` Markus Armbruster
2017-02-07 9:26 ` Kevin Wolf
2017-02-24 16:04 ` Markus Armbruster
2017-02-24 16:39 ` Daniel P. Berrange
2017-02-24 17:17 ` Eric Blake
2017-02-24 19:15 ` Markus Armbruster [this message]
2017-02-27 10:27 ` Markus Armbruster
2017-02-27 10:59 ` Kevin Wolf
2017-02-27 13:36 ` Markus Armbruster
2017-02-27 19:47 ` Eric Blake
2017-02-28 8:24 ` Markus Armbruster
2017-02-27 19:43 ` Eric Blake
2017-02-28 8:41 ` Markus Armbruster
2017-03-01 9:24 ` Markus Armbruster
2017-03-21 8:40 ` 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=87bmtr2yes.fsf@dusky.pond.sub.org \
--to=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=eblake@redhat.com \
--cc=kwolf@redhat.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.