From: Kevin Wolf <kwolf@redhat.com>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, armbru@redhat.com, mreitz@redhat.com,
jcody@redhat.com, eblake@redhat.com
Subject: Re: [Qemu-devel] [Qemu-block] [RFC][BROKEN] rbd: Allow configuration of authentication scheme
Date: Wed, 18 Apr 2018 11:41:05 +0200 [thread overview]
Message-ID: <20180418094105.GD4971@localhost.localdomain> (raw)
In-Reply-To: <20180406080406.GA4850@localhost.localdomain>
Am 06.04.2018 um 10:04 hat Kevin Wolf geschrieben:
> Am 05.04.2018 um 19:06 hat Kevin Wolf geschrieben:
> > The legacy command line syntax supports a "password-secret" option that
> > allows to pass an authentication key to Ceph. This was not supported in
> > QMP so far.
> >
> > This patch introduces authentication options in the QAPI schema, makes
> > them do the corresponding rados_conf_set() calls and adds compatibility
> > code that translates the old "password-secret" option both for opening
> > and creating images to the new set of options.
> >
> > Note that the old option didn't allow to explicitly specify the set of
> > allowed authentication schemes. The compatibility code assumes that if
> > "password-secret" is given, only the cephx scheme is allowed. If it's
> > missing, both none and cephx are allowed because the configuration file
> > could still provide a key.
>
> There is another problem here that suggests that maybe this is not the
> right QAPI schema after all: The defaults needed for command line
> compatibility and those promised in the QAPI schema are conflicting.
>
> The required command line behaviour is as described above:
>
> * password-secret given: only cephx
> * no options given: cephx, none
>
> The desired QMP default behaviour is:
>
> * auth-cephx given: allow cephx
> * auth-none given: allow none
> * both given: allow both
> * no options given: error
>
> In .bdrv_open() there is no way to distinguish the "no options given" of
> the command line from that of QMP. The current implementation allows
> everything if no options are given, i.e. it keeps existing command lines
> working, but it doesn't correctly implement the behaviour described in
> the QAPI schema.
>
> I don't think changing the description of the QAPI schema would be a
> good idea, it would be a rather surprising interface.
>
> > Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> > ---
> >
> > This doesn't actually work correctly yet because the way that options
> > are passed through the block layer (QAPI -> QemuOpts -> QDict). Before
> > we fix or hack around this, let's make sure this is the schema that we
> > want.
> >
> > The two known problems are:
> >
> > 1. QDict *options in qemu_rbd_open() may contain options either in their
> > proper QObject types (if passed from blockdev-add) or as strings
> > (-drive). Both forms can be mixed in the same options QDict.
> >
> > rbd uses the keyval visitor to convert the options into a QAPI
> > object. This means that it requires all options to be strings. This
> > patch, however, introduces a bool property, so the visitor breaks
> > when it gets its input from blockdev-add.
> >
> > Options to hack around the problem:
> >
> > a. Do an extra conversion step or two and go through QemuOpts like
> > some other block drivers. When I offered something like this to
> > Markus a while ago in a similar case, he rejected the idea.
> >
> > b. Introduce a qdict_stringify_entries() that just does what its name
> > says. It would be called before the running keyval visitor so that
> > only strings will be present in the QDict.
> >
> > c. Do a local one-off hack that checks if the entry with the key
> > "auth-none" is a QBool, and if so, overwrite it with a string. The
> > problem will reappear with the next non-string option.
> >
> > (d. Get rid of the QDict detour and work only with QAPI objects
> > everywhere. Support rbd authentication only in QEMU 4.0.)
> >
> > 2. The proposed schema allows 'auth-cephx': {} as a valid option with
> > the meaning that the cephx authentication scheme is enabled, but no
> > key is given (e.g. it is taken from the config file).
> >
> > However, an empty dict cannot currently be represented by flattened
> > QDicts. We need to find a way to enable this. I think this will be
> > externally visible because it directly translates into the dotted
> > syntax of -blockdev, so we may want to be careful.
> >
> > Any thoughts on the proposed QAPI schema or the two implementation
> > problems are welcome.
Ping?
If nobody has an opinion, we might as well just revert the revert and
bring the legacy interface 1:1 to QMP.
Kevin
next prev parent reply other threads:[~2018-04-18 9:41 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 ` Kevin Wolf [this message]
2018-04-18 13:21 ` 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
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=20180418094105.GD4971@localhost.localdomain \
--to=kwolf@redhat.com \
--cc=armbru@redhat.com \
--cc=eblake@redhat.com \
--cc=jcody@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).