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 > --- > 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