]> git.proxmox.com Git - mirror_qemu.git/commit - block/qcow2.c
qcow2: fix image corruption after committing qcow2 image into base
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 17 Nov 2017 11:29:13 +0000 (11:29 +0000)
committerKevin Wolf <kwolf@redhat.com>
Fri, 17 Nov 2017 12:36:03 +0000 (13:36 +0100)
commitf06033295b51d4868c2b4921ad2287e8f55eb688
tree2f67d97df74504ba85d0e5ed5f41c3148bf84aa6
parent398e6ad014df261d20d3fd6cff2cfbf940bac714
qcow2: fix image corruption after committing qcow2 image into base

After committing the qcow2 image contents into the base image, qemu-img
will call bdrv_make_empty to drop the payload in the layered image.

When this is done for qcow2 images, it blows away the LUKS encryption
header, making the resulting image unusable. There are two codepaths
for emptying a qcow2 image, and the second (slower) codepath leaves
the LUKS header intact, so force use of that codepath.

Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qcow2.c
tests/qemu-iotests/198 [new file with mode: 0755]
tests/qemu-iotests/198.out [new file with mode: 0644]
tests/qemu-iotests/common.filter
tests/qemu-iotests/group