[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCHv3 1/2] qemu-img: find the highest offset in use
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCHv3 1/2] qemu-img: find the highest offset in use during check |
Date: |
Wed, 23 Jan 2013 16:24:48 +0100 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Mon, Jan 21, 2013 at 09:25:12AM -0500, Federico Simoncelli wrote:
> @@ -1154,7 +1154,7 @@ int qcow2_check_refcounts(BlockDriverState *bs,
> BdrvCheckResult *res,
> s->refcount_table_offset,
> s->refcount_table_size * sizeof(uint64_t));
>
> - for(i = 0; i < s->refcount_table_size; i++) {
> + for(i = 0, highest_cluster = 0; i < s->refcount_table_size; i++) {
> uint64_t offset, cluster;
> offset = s->refcount_table[i];
> cluster = offset >> s->cluster_bits;
This is the wrong for loop? It should be the next one down.
Stefan