]> git.proxmox.com Git - mirror_qemu.git/commit
qcow2: fix condition in is_zero_cluster
authorDenis V. Lunev <den@openvz.org>
Tue, 17 May 2016 09:15:42 +0000 (12:15 +0300)
committerKevin Wolf <kwolf@redhat.com>
Thu, 19 May 2016 14:45:31 +0000 (16:45 +0200)
commitf575f145f4fa97fdbb9bbb4df62dfeada3f15dc4
tree0e4ddab1eabc09e27f33e78a9dce275996526b00
parentb97511c7bc88bc487cacbfab349eb6023ae4f49b
qcow2: fix condition in is_zero_cluster

We should check for (res & BDRV_BLOCK_ZERO) only. The situation when we
will have !(res & BDRV_BLOCK_DATA) and will not have BDRV_BLOCK_ZERO is
not possible for images with bdi.unallocated_blocks_are_zero == true.

For those images where it's false, however, it can happen and we must
not consider the data zeroed then or we would corrupt the image.

Signed-off-by: Denis V. Lunev <den@openvz.org>
CC: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qcow2.c