On 11.09.20 16:09, Alberto Garcia wrote:
> qcow2_alloc_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.
> 
> See 388e581615 for a similar change to qcow2_get_cluster_offset().
> 
> Signed-off-by: Alberto Garcia <be...@igalia.com>
> ---
>  block/qcow2.h         |  6 +++---
>  block/qcow2-cluster.c | 14 ++++++++++----
>  block/qcow2.c         | 36 +++++++++++++-----------------------
>  3 files changed, 26 insertions(+), 30 deletions(-)

First of all:

Reviewed-by: Max Reitz <mre...@redhat.com>

However, I wonder what you think about “cluster_offset” in
qcow2_alloc_host_offset.  It isn’t a cluster offset anymore.  Can/should
we rename it?

(Perhaps call the parameter host_offset_ptr, and then rename the local
cluster_offset to host_offset?)

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to