qcow2: convert QCow2 to use QCryptoBlock for encryption
commitb25b387fa5928e516cb2c9e7fde68e958bd7e50a
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 23 Jun 2017 16:24:10 +0000 (23 17:24 +0100)
committerMax Reitz <mreitz@redhat.com>
Tue, 11 Jul 2017 15:44:56 +0000 (11 17:44 +0200)
treedc53af6ece398ec328ec8aa1ad4aa84c15e93ba2
parent446d306d23c8b568affec104d74f84f48d5eaa24
qcow2: convert QCow2 to use QCryptoBlock for encryption

This converts the qcow2 driver to make use of the QCryptoBlock
APIs for encrypting image content, using the legacy QCow2 AES
scheme.

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.qcow2,encrypt.key-secret=sec0

The test 087 could be simplified since there is no longer a
difference in behaviour when using blockdev_add with encrypted
images for the running vs stopped CPU state.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Message-id: 20170623162419.26068-12-berrange@redhat.com
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
14 files changed:
block/qcow2-cluster.c
block/qcow2.c
block/qcow2.h
qapi/block-core.json
tests/qemu-iotests/049
tests/qemu-iotests/049.out
tests/qemu-iotests/082.out
tests/qemu-iotests/087
tests/qemu-iotests/087.out
tests/qemu-iotests/134
tests/qemu-iotests/134.out
tests/qemu-iotests/158
tests/qemu-iotests/158.out
tests/qemu-iotests/common