[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/2] qcow2: Convert qcow2_alloc_cluster_offset() into qcow2_a
From: |
Max Reitz |
Subject: |
Re: [PATCH 2/2] qcow2: Convert qcow2_alloc_cluster_offset() into qcow2_alloc_host_offset() |
Date: |
Mon, 14 Sep 2020 14:14:36 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
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 <berto@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 <mreitz@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?)
signature.asc
Description: OpenPGP digital signature