Max Reitz 14a58a4e0c qcow2: Respect new_block in alloc_refcount_block()
When choosing a new place for the refcount table, alloc_refcount_block()
tries to infer the number of clusters used so far from its argument
cluster_index (which comes from the idea that if any cluster with an
index greater than cluster_index was in use, the refcount table would
have to be big enough already to describe cluster_index).

However, there is a cluster that may be at or after cluster_index, and
which is not covered by the refcount structures, and that is the new
refcount block new_block. Therefore, it should be taken into account for
the blocks_used calculation.

Also, because new_block already describes (or is intended to describe)
cluster_index, we may not put the new refcount structures there.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Message-id: 1423598552-24301-2-git-send-email-mreitz@redhat.com
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
2015-03-16 12:10:30 -04:00
..
2015-01-13 11:47:56 +00:00
2015-03-10 14:02:21 +01:00
2015-02-06 17:24:21 +01:00
2015-03-10 10:49:25 +01:00
2015-02-16 14:36:03 +00:00
2015-03-10 08:15:34 +03:00
2014-12-10 10:31:19 +01:00
2015-02-06 17:24:21 +01:00
2015-02-16 15:07:19 +00:00
2014-12-12 13:16:56 +00:00
2015-02-16 15:07:17 +00:00