qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 05/13] qapi: Formalize qcow encryption probing


From: Max Reitz
Subject: Re: [Qemu-devel] [PATCH 05/13] qapi: Formalize qcow encryption probing
Date: Fri, 11 May 2018 20:07:31 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

On 2018-05-10 16:24, Eric Blake wrote:
> On 05/09/2018 11:55 AM, Max Reitz wrote:
>> Currently, you can give no encryption format for a qcow 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 <address@hidden>
>> ---
> 
>>   ##
>>   # @BlockdevQcowEncryptionFormat:
>>   #
>>   # @aes: AES-CBC with plain64 initialization vectors
>>   #
>> +# @from-image:      Determine the encryption format from the image
>> +#                   header.  This only allows the use of the
>> +#                   key-secret option.  (Since: 2.13)
>> +#
>>   # Since: 2.10
>>   ##
>>   { 'enum': 'BlockdevQcowEncryptionFormat',
>> -  'data': [ 'aes' ] }
>> +  'data': [ 'aes', 'from-image' ] }
> 
> Overkill.  Why not just:
> 
>>     ##
>>   # @BlockdevQcowEncryption:
>> @@ -2728,9 +2748,11 @@
>>   # Since: 2.10
>>   ##
>>   { 'union': 'BlockdevQcowEncryption',
>> -  'base': { 'format': 'BlockdevQcowEncryptionFormat' },
>> +  'base': { '*format': 'BlockdevQcowEncryptionFormat' },
>>     'discriminator': 'format',
>> -  'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
>> +  'default-variant': 'from-image',
> 
> 'default-variant': 'aes'
> 
>> +  'data': { 'aes': 'QCryptoBlockOptionsQCow',
> 
> and call it good, because there are no other options to pick from, so
> 'from-image' would always resolve to 'aes' anyway.

Hmmmm.  Yes. :-)

Max

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]