mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
qcow: convert QCow to use QCryptoBlock for encryption
This converts the qcow driver to make use of the QCryptoBlock APIs for encrypting image content. This is only wired up to permit use of the legacy QCow encryption format. Users who wish to have the strong LUKS format should switch to qcow2 instead. With this change it is now required to use the QCryptoSecret object for providing passwords, instead of the current block password APIs / interactive prompting. $QEMU \ -object secret,id=sec0,file=/home/berrange/encrypted.pw \ -drive file=/home/berrange/encrypted.qcow,encrypt.format=aes,\ encrypt.key-secret=sec0 Though note that running QEMU system emulators with the AES encryption is no longer supported, so while the above syntax is valid, QEMU will refuse to actually run the VM in this particular example. Likewise when creating images with the legacy AES-CBC format qemu-img create -f qcow \ --object secret,id=sec0,file=/home/berrange/encrypted.pw \ -o encrypt.format=aes,encrypt.key-secret=sec0 \ /home/berrange/encrypted.qcow 64M Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-id: 20170623162419.26068-10-berrange@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
1fad1f9400
commit
d85f4222b4
4 changed files with 158 additions and 108 deletions
|
@ -2281,6 +2281,42 @@
|
|||
'data': { 'flags': 'Qcow2OverlapCheckFlags',
|
||||
'mode': 'Qcow2OverlapCheckMode' } }
|
||||
|
||||
##
|
||||
# @BlockdevQcowEncryptionFormat:
|
||||
#
|
||||
# @aes: AES-CBC with plain64 initialization vectors
|
||||
#
|
||||
# Since: 2.10
|
||||
##
|
||||
{ 'enum': 'BlockdevQcowEncryptionFormat',
|
||||
'data': [ 'aes' ] }
|
||||
|
||||
##
|
||||
# @BlockdevQcowEncryption:
|
||||
#
|
||||
# Since: 2.10
|
||||
##
|
||||
{ 'union': 'BlockdevQcowEncryption',
|
||||
'base': { 'format': 'BlockdevQcowEncryptionFormat' },
|
||||
'discriminator': 'format',
|
||||
'data': { 'aes': 'QCryptoBlockOptionsQCow' } }
|
||||
|
||||
##
|
||||
# @BlockdevOptionsQcow:
|
||||
#
|
||||
# Driver specific block device options for qcow.
|
||||
#
|
||||
# @encrypt: Image decryption options. Mandatory for
|
||||
# encrypted images, except when doing a metadata-only
|
||||
# probe of the image.
|
||||
#
|
||||
# Since: 2.10
|
||||
##
|
||||
{ 'struct': 'BlockdevOptionsQcow',
|
||||
'base': 'BlockdevOptionsGenericCOWFormat',
|
||||
'data': { '*encrypt': 'BlockdevQcowEncryption' } }
|
||||
|
||||
|
||||
##
|
||||
# @BlockdevOptionsQcow2:
|
||||
#
|
||||
|
@ -2976,7 +3012,7 @@
|
|||
'null-co': 'BlockdevOptionsNull',
|
||||
'parallels': 'BlockdevOptionsGenericFormat',
|
||||
'qcow2': 'BlockdevOptionsQcow2',
|
||||
'qcow': 'BlockdevOptionsGenericCOWFormat',
|
||||
'qcow': 'BlockdevOptionsQcow',
|
||||
'qed': 'BlockdevOptionsGenericCOWFormat',
|
||||
'quorum': 'BlockdevOptionsQuorum',
|
||||
'raw': 'BlockdevOptionsRaw',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue