qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v5 03/11] qcow2: Split qcow2_check_refcounts()


From: Kevin Wolf
Subject: Re: [Qemu-devel] [PATCH v5 03/11] qcow2: Split qcow2_check_refcounts()
Date: Mon, 20 Oct 2014 16:45:04 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 29.08.2014 um 23:40 hat Max Reitz geschrieben:
> Put the code for calculating the reference counts and comparing them
> during qemu-img check into own functions.
> 
> Signed-off-by: Max Reitz <address@hidden>
> Reviewed-by: BenoƮt Canet <address@hidden>

> +static int calculate_refcounts(BlockDriverState *bs, BdrvCheckResult *res,
> +                               BdrvCheckMode fix, uint16_t **refcount_table,
> +                               int64_t *nb_clusters)
[..]
> +    return check_refblocks(bs, res, fix, refcount_table, nb_clusters);
> +}

At first I wanted to comment that it would make more sense to call
check_refblocks() from the main function qcow2_check_refcounts(). Now I
see that you call it here because it also increases the refcounts for
the refblocks.

The only thing we could consider here is to split the function into a
counting part that is called in calculate_refcounts() and a checking
part that is called in qcow2_check_refcounts(). I'll leave that to you,
though.

Reviewed-by: Kevin Wolf <address@hidden>



reply via email to

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