aboutsummaryrefslogtreecommitdiff
path: root/linux-user
diff options
context:
space:
mode:
authorAlberto Garcia <berto@igalia.com>2018-02-05 16:33:20 +0200
committerMax Reitz <mreitz@redhat.com>2018-02-13 16:59:59 +0100
commitfd630039c0478919434cd2f9a4b9a72f61312624 (patch)
tree55651e34e0028fe5d2cffb2ac0aabf218db1919a /linux-user
parentc03bfc5bba594a961ddc3c755fd4c0e45c41bae4 (diff)
qcow2: Update qcow2_get_cluster_offset() to support L2 slices
qcow2_get_cluster_offset() checks how many contiguous bytes are available at a given offset. The returned number of bytes is limited by the amount that can be addressed without having to load more than one L2 table. Since we'll be loading L2 slices instead of full tables this patch changes the limit accordingly using the size of the L2 slice for the calculations instead of the full table size. One consequence of this is that with small L2 slices operations such as 'qemu-img map' will need to iterate in more steps because each qcow2_get_cluster_offset() call will potentially return a smaller number. However the code is already prepared for that so this doesn't break semantics. The l2_table variable is also renamed to l2_slice to reflect this, and offset_to_l2_index() is replaced with offset_to_l2_slice_index(). Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 6b602260acb33da56ed6af9611731cb7acd110eb.1517840877.git.berto@igalia.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'linux-user')
0 files changed, 0 insertions, 0 deletions