From: Jeff Cody <jcody@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>,
jdurgin@redhat.com, mreitz@redhat.com, qemu-devel@nongnu.org,
qemu-block@nongnu.org
Subject: Re: [Qemu-devel] [RFC][BROKEN] rbd: Allow configuration of authentication scheme
Date: Fri, 27 Apr 2018 00:27:22 -0400 [thread overview]
Message-ID: <20180427042722.GY12302@localhost.localdomain> (raw)
In-Reply-To: <20180425075019.GA4652@localhost.localdomain>
On Wed, Apr 25, 2018 at 09:50:19AM +0200, Kevin Wolf wrote:
> Am 24.04.2018 um 20:26 hat Jeff Cody geschrieben:
> > On Fri, Apr 20, 2018 at 04:39:02PM +0200, Markus Armbruster wrote:
> > > >> Ways to avoid the troublesome auth-cephx: {}:
> > > >>
> > > >> (A) Make auth-cephx a bool, rely on the other ways to provide the key
> > > >>
> > > >> (B) Make auth-cephx a bool and add the @key-secret member next to it
> > > >>
> > > >> Like @user, the member is meaningless with auth-none.
> > > >>
> > > >> (C) Make auth-cephx.key-secret a mandatory StrOrNull
> > > >>
> > > >> Should take care of "vanishes on flattening" problem, but dotted key
> > > >> syntax is still screwed: since any value is a valid string, there's
> > > >> none left for null. My take would be that if you want to say
> > > >> auth-cephx.key-secret: {}, you get to say it in JSON.
> > > >>
> > > >> Aside: check_alternate() tries to catch such alternates, but we
> > > >> failed to update it when we added first class null. *sigh*
> > > >>
> > > >> Which one do you hate least?
> > > >
> > > > What should happen with null when you stringify it? If we want to take
> > > > the options QDict, stringify all entries and run them through the keyval
> > > > visitor, I'm almost sure that null will be lost.
> > >
> > > For the stringify idea to work, the keyval visitor needs to map the
> > > string right back to the original value.
> > >
> > > The keyval visitor currently requires the value to be null, not a
> > > string.
> > >
> > > Therefore, the stringify operation must leave null alone. Not pretty,
> > > but works.
>
> Okay, I didn't know that the keyval visitor has any way to specify null.
> It doesn't really matter what the exact representation is as long as we
> can generate it. So sure, that's workable then.
>
> > > You might ask why not change the keyval visitor instead so it expects ""
> > > rather than null. That's no good, because it makes StrOrNull ambiguous.
> > >
> > > keyval.c can only create string scalars. I think "use JSON if you want
> > > to specify null" is still good enough. We can make keyval.c more
> > > expressive if we need to, but (1) I don't think we should block this
> > > work on it, and (2) see "hairy" above.
> > >
> > > > So (A) doesn't work unless we can specify what "other ways" are that are
> > > > acceptable for libvirt,
> > >
> > > Yes.
> > >
> > > > and (C) probably doesn't play well with b. above
> > > > (the qdict_stringify_entries() for handling mixed type QDicts).
> > >
> > > I think it could be done, and tried to sketch how.
> > >
> > > > Looks like only (B) is left as viable, so that's automatically the one I
> > > > hate least of these. If we can fix the problems, I think I'd prefer (C),
> > > > though.
> > >
> > > I could accept (B), in particular since it mirrors existing @user.
>
> I don't like (B) much because it adds additional rules which options
> must, may or can be present depending on the presence or value of other
> options. This kind of dependencies should be visible in the schema with
> nested structs and unions, and checked for consistency by QAPI, rather
> than being checked individually in .bdrv_open() implementations.
>
> As for @user, you had sources to confirm that it is indeed irrelevant
> for 'none', so I'd rather do the opposite thing and move it to
> RbdAuthCephx.
>
> > > I'm happy to help with exploring (C).
> > >
> > > What's the next step?
> >
> > My preference is (B). Primarily because I don't like the idea of breaking
> > dotted key syntax for null keys. I'd rather see something more verbose like
> > (B), that can still be navigated correctly both ways.
>
> Yes, it's not perfect, but it doesn't make any functionality unavailable
> because you can always using JSON, even on the command line. Dotted
> syntax is nicer for manual use, but in this specific case I think null
> will be the default, so there is no need to specify it explicitly
> anyway - neither with dotted key syntax nor with JSON.
>
Good point on the default case, that essentially negates my concerns.
> I prefer slightly unwieldy command line syntax to getting the internally
> used data types wrong (= hard to use correctly).
>
Fair enough.
> > How about I put together a patch with (B) for an RFC v2?
>
> How about doing the same with (C) and moving @user? :-)
>
Sounds like a plan!
-Jeff
prev parent reply other threads:[~2018-04-27 4:27 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-05 17:06 [Qemu-devel] [RFC][BROKEN] rbd: Allow configuration of authentication scheme Kevin Wolf
2018-04-06 8:04 ` Kevin Wolf
2018-04-18 9:41 ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2018-04-18 13:21 ` [Qemu-devel] " Eric Blake
2018-04-18 13:40 ` Kevin Wolf
2018-04-18 13:26 ` Eric Blake
2018-04-18 13:50 ` Kevin Wolf
2018-04-18 14:16 ` Eric Blake
2018-04-18 14:26 ` Kevin Wolf
2018-04-18 15:06 ` Markus Armbruster
2018-04-18 16:28 ` Kevin Wolf
2018-04-18 16:34 ` Daniel P. Berrangé
2018-04-18 16:52 ` Kevin Wolf
2018-04-18 17:04 ` Daniel P. Berrangé
2018-04-20 13:34 ` Markus Armbruster
2018-04-20 13:55 ` Daniel P. Berrangé
2018-04-20 14:50 ` Markus Armbruster
2018-04-20 14:53 ` Daniel P. Berrangé
2018-04-20 16:15 ` Markus Armbruster
2018-04-20 14:39 ` Markus Armbruster
2018-04-24 18:26 ` Jeff Cody
2018-04-25 7:50 ` Kevin Wolf
2018-04-27 4:27 ` Jeff Cody [this message]
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=20180427042722.GY12302@localhost.localdomain \
--to=jcody@redhat.com \
--cc=armbru@redhat.com \
--cc=jdurgin@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).