]> git.ipfire.org Git - thirdparty/qemu.git/commit
qcow2: count_contiguous_clusters and compression
authorMax Reitz <mreitz@redhat.com>
Fri, 27 Sep 2013 10:14:15 +0000 (12:14 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Mon, 9 Dec 2013 17:40:30 +0000 (11:40 -0600)
commit4a5bf69f78e20a64f35770612ee897da4d80082e
tree486bb599f56d80e14154600ca67ba08ceefdd30a
parent53e8cf93b3ecdb32ca4aa93d04b0a959988456fa
qcow2: count_contiguous_clusters and compression

The function is not intended to be used on compressed clusters and will
not work correctly, if used anyway, since L2E_OFFSET_MASK is not the
right mask for determining the offset of compressed clusters. Therefore,
assert that the first cluster is not compressed and always include the
compression flag in the mask of significant flags, i.e., stop the search
as soon as a compressed cluster occurs.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
(cherry picked from commit 15684a474286cc2c6106c756ddd095a21d058970)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
block/qcow2-cluster.c