On 03.07.20 17:57, Alberto Garcia wrote: > qcow2_get_cluster_offset() takes an (unaligned) guest offset and > returns the (aligned) offset of the corresponding cluster in the qcow2 > image. > > In practice none of the callers need to know where the cluster starts > so this patch makes the function calculate and return the final host > offset directly. The function is also renamed accordingly. > > There is a pre-existing exception with compressed clusters: in this > case the function returns the complete cluster descriptor (containing > the offset and size of the compressed data). This does not change with > this patch but it is now documented. > > Signed-off-by: Alberto Garcia <be...@igalia.com> > --- > block/qcow2.h | 4 ++-- > block/qcow2-cluster.c | 41 +++++++++++++++++++++++------------------ > block/qcow2.c | 24 +++++++----------------- > 3 files changed, 32 insertions(+), 37 deletions(-)
Reviewed-by: Max Reitz <mre...@redhat.com>
signature.asc
Description: OpenPGP digital signature