summaryrefslogtreecommitdiff
path: root/block/qed-cluster.c
diff options
context:
space:
mode:
authorAlberto Garcia <berto@igalia.com>2018-02-05 16:33:30 +0200
committerMax Reitz <mreitz@redhat.com>2018-02-13 17:00:00 +0100
commit415184f52031cd16ff7ea3702e0ef9f2f7edec9a (patch)
tree7007fb47d54b3cc071315b0e01bef1246d0319cc /block/qed-cluster.c
parent226494ff69d3d0563d00c8dbab30e740191d4e93 (diff)
downloadqemu-415184f52031cd16ff7ea3702e0ef9f2f7edec9a.zip
qcow2: Update expand_zero_clusters_in_l1() to support L2 slices
expand_zero_clusters_in_l1() expands zero clusters as a necessary step to downgrade qcow2 images to a version that doesn't support metadata zero clusters. This function takes an L1 table (which may or may not be active) and iterates over all its L2 tables looking for zero clusters. Since we'll be loading L2 slices instead of full tables we need to add an extra loop that iterates over all slices of each L2 table, and we should also use the slice size when allocating the buffer used when the L1 table is not active. This function doesn't need any additional changes so apart from that this patch simply updates the variable name from l2_table to l2_slice. Finally, and since we have to touch the bdrv_read() / bdrv_write() calls anyway, this patch takes the opportunity to replace them with the byte-based bdrv_pread() / bdrv_pwrite(). Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 43590976f730501688096cff103f2923b72b0f32.1517840877.git.berto@igalia.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block/qed-cluster.c')
0 files changed, 0 insertions, 0 deletions