qcow2: Fix preallocation size formula
commit92413c16be8eee53a3b60739f2a28a1463651f47
authorMax Reitz <mreitz@redhat.com>
Wed, 3 May 2017 23:11:17 +0000 (4 01:11 +0200)
committerKevin Wolf <kwolf@redhat.com>
Thu, 11 May 2017 10:08:24 +0000 (11 12:08 +0200)
tree2640e046094d04c39103213efe716a1f9ab08f30
parentde9efdb33454ae952c72ed826c54981d498b6c10
qcow2: Fix preallocation size formula

When calculating the number of reftable entries, we should actually use
the number of refblocks and not (wrongly[1]) re-calculate it.

[1] "Wrongly" means: Dividing the number of clusters by the number of
    entries per refblock and rounding down instead of up.

Reported-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qcow2.c