From: Eric Blake <eblake@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>,
"Max Reitz" <mreitz@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
Michael Roth <mdroth@linux.vnet.ibm.com>,
qemu-devel@nongnu.org, qemu-block@nongnu.org,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH 04/13] qapi: Formalize qcow2 encryption probing
Date: Thu, 10 May 2018 09:22:09 -0500 [thread overview]
Message-ID: <c9718ca1-d06d-20fc-32c6-ad2425532e5a@redhat.com> (raw)
In-Reply-To: <20180510075854.GC23581@redhat.com>
On 05/10/2018 02:58 AM, Daniel P. Berrangé wrote:
> On Wed, May 09, 2018 at 06:55:21PM +0200, Max Reitz wrote:
>> Currently, you can give no encryption format for a qcow2 file while
>> still passing a key-secret. That does not conform to the schema, so
>> this patch changes the schema to allow it.
>>
>> Signed-off-by: Max Reitz <mreitz@redhat.com>
>> ---
>> qapi/block-core.json | 44 ++++++++++++++++++++++++++++++++++++++++----
>> 1 file changed, 40 insertions(+), 4 deletions(-)
>> { 'union': 'BlockdevQcow2Encryption',
>> - 'base': { 'format': 'BlockdevQcow2EncryptionFormat' },
>> + 'base': { '*format': 'BlockdevQcow2EncryptionFormat' },
>> 'discriminator': 'format',
>> + 'default-variant': 'from-image',
>> 'data': { 'aes': 'QCryptoBlockOptionsQCow',
>> - 'luks': 'QCryptoBlockOptionsLUKS'} }
>> + 'luks': 'QCryptoBlockOptionsLUKS',
>> + 'from-image': 'BlockdevQcow2EncryptionSecret' } }
>
> Bike-shedding on name, how about "auto" or "probe" ?
Either of those sounds nicer to me; 'auto' might be better in the
context of creation (that way, we can state that creating a NEW image
with x-blockdev-create maps 'auto' to 'luks'; while connecting to an
EXISTING image maps 'auto' to either 'aes' or 'luks' as appropriate).
>
> IIUC, this schema addition means the QAPI parser now allows
>
> encrypt.format=from-image,encrypt.key-secret=sec0,...other opts...
Yes. You could, perhaps, add a special case on the command line parsing
code to reject an explicit use of format=from-image, but the QMP should
not reject an explicit discriminator.
Hmm, it plays in with my comment on 1/13 - should the QMP parser
automatically set has_discriminator to true when it supplies the
default? If it does, you lose the ability to see whether the user
supplied an explicit encrypt.format=from-image (or the equivalent when
using QMP instead of the command line), if you wanted to enforce that
the user MUST omit format when relying on the from-image variant.
I don't see a problem in allowing the user to explicitly specify the
name of the default branch, but I _do_ think the patch is incomplete for
not handling the new QCOW_CRYPT_FROM_IMAGE case and converting it as
soon as possible back into one of the other two preferred enum values.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
next prev parent reply other threads:[~2018-05-10 14:22 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-09 16:55 [Qemu-devel] [PATCH 00/13] block: Try to create well typed json:{} filenames Max Reitz
2018-05-09 16:55 ` [Qemu-devel] [PATCH 01/13] qapi: Add default-variant for flat unions Max Reitz
2018-05-10 13:12 ` Eric Blake
2018-05-10 13:18 ` Eric Blake
2018-05-11 17:59 ` Max Reitz
2018-05-11 18:13 ` Eric Blake
2018-05-11 17:38 ` Max Reitz
2018-05-09 16:55 ` [Qemu-devel] [PATCH 02/13] docs/qapi: Document optional discriminators Max Reitz
2018-05-10 13:14 ` Eric Blake
2018-05-09 16:55 ` [Qemu-devel] [PATCH 03/13] tests: Add QAPI optional discriminator tests Max Reitz
2018-05-10 14:08 ` Eric Blake
2018-05-11 18:06 ` Max Reitz
2018-05-09 16:55 ` [Qemu-devel] [PATCH 04/13] qapi: Formalize qcow2 encryption probing Max Reitz
2018-05-10 7:58 ` Daniel P. Berrangé
2018-05-10 14:22 ` Eric Blake [this message]
2018-05-11 17:32 ` Max Reitz
2018-05-09 16:55 ` [Qemu-devel] [PATCH 05/13] qapi: Formalize qcow " Max Reitz
2018-05-10 14:24 ` Eric Blake
2018-05-10 14:32 ` Daniel P. Berrangé
2018-05-11 18:07 ` Max Reitz
2018-05-09 16:55 ` [Qemu-devel] [PATCH 06/13] block: Add block-specific QDict header Max Reitz
2018-05-10 14:54 ` Eric Blake
2018-05-11 18:11 ` Max Reitz
2018-06-06 13:10 ` Markus Armbruster
2018-06-06 13:17 ` Markus Armbruster
2018-06-06 14:19 ` Markus Armbruster
2018-06-06 14:35 ` Markus Armbruster
2018-05-09 16:55 ` [Qemu-devel] [PATCH 07/13] qdict: Add qdict_stringify_for_keyval() Max Reitz
2018-05-11 18:39 ` Eric Blake
2018-05-11 21:42 ` Max Reitz
2018-05-09 16:55 ` [Qemu-devel] [PATCH 08/13] tests: Add qdict_stringify_for_keyval() test Max Reitz
2018-05-10 16:02 ` Eric Blake
2018-05-11 18:13 ` Max Reitz
2018-05-11 18:33 ` Eric Blake
2018-05-09 16:55 ` [Qemu-devel] [PATCH 09/13] qdict: Make qdict_flatten() shallow-clone-friendly Max Reitz
2018-05-11 18:44 ` Eric Blake
2018-05-09 16:55 ` [Qemu-devel] [PATCH 10/13] tests: Add QDict clone-flatten test Max Reitz
2018-05-11 18:46 ` Eric Blake
2018-05-11 21:41 ` Max Reitz
2018-05-09 16:55 ` [Qemu-devel] [PATCH 11/13] block: Try to create well typed json:{} filenames Max Reitz
2018-05-09 16:55 ` [Qemu-devel] [PATCH 12/13] iotests: Test internal option typing Max Reitz
2018-05-09 16:55 ` [Qemu-devel] [PATCH 13/13] iotests: qcow2's encrypt.format is now optional Max Reitz
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=c9718ca1-d06d-20fc-32c6-ad2425532e5a@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=kwolf@redhat.com \
--cc=mdroth@linux.vnet.ibm.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).