qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH v3 12/27] qcow2: Replace QCOW2_CLUSTER_* with QCOW2_SUBCL


From: Max Reitz
Subject: Re: [RFC PATCH v3 12/27] qcow2: Replace QCOW2_CLUSTER_* with QCOW2_SUBCLUSTER_*
Date: Fri, 21 Feb 2020 12:35:55 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1

On 22.12.19 12:36, Alberto Garcia wrote:
> In order to support extended L2 entries some functions of the qcow2
> driver need to start dealing with subclusters instead of clusters.
> 
> qcow2_get_cluster_offset() is modified to return the subcluster
> type instead of the cluster type, and all callers are updated to
> replace all values of QCow2ClusterType with their QCow2SubclusterType
> equivalents (as returned by qcow2_cluster_to_subcluster_type()).
> 
> This patch only changes the data types, there are no semantic changes.
> 
> Signed-off-by: Alberto Garcia <address@hidden>
> ---
>  block/qcow2-cluster.c | 19 +++++-----
>  block/qcow2.c         | 82 +++++++++++++++++++++++++------------------
>  block/qcow2.h         |  3 +-
>  3 files changed, 60 insertions(+), 44 deletions(-)

[...]

> diff --git a/block/qcow2.c b/block/qcow2.c
> index e7607d90d4..9277d680ef 100644
> --- a/block/qcow2.c
> +++ b/block/qcow2.c

[...]

> @@ -2223,22 +2227,23 @@ static coroutine_fn int 
> qcow2_co_preadv_part(BlockDriverState *bs,
>          }
>  
>          qemu_co_mutex_lock(&s->lock);
> -        ret = qcow2_get_cluster_offset(bs, offset, &cur_bytes, 
> &cluster_offset);
> +        ret = qcow2_get_cluster_offset(bs, offset, &cur_bytes,
> +                                       &cluster_offset, &type);

I wonder whether this is kind of a bug fix here.  It’s entirely possible
that @ret isn’t set after this, and then we get to the “out” label,
which has a check on “if (ret == 0)”.

Reviewed-by: Max Reitz <address@hidden>

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]