qcow2: Correct bitmap size in zero expansion
commite390cf5a9722d3f3cc54efb505f6ff37fa554b11
authorMax Reitz <mreitz@redhat.com>
Wed, 25 Sep 2013 10:07:22 +0000 (25 12:07 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 27 Sep 2013 09:16:35 +0000 (27 11:16 +0200)
tree27e3c5dfadbfe70735c3a556ab8bda85386a9b3b
parentfef9c19139f4d69a080d99b8cbade163d0bbf0fc
qcow2: Correct bitmap size in zero expansion

Since the expanded_clusters bitmap is addressed using host offsets in
the underlying image file, the correct size to use for allocating the
bitmap is not determined by the guest disk image but by the underlying
host image file.

Furthermore, this size may change during the expansion due to cluster
allocations on growable image files. In this case, the bitmap needs to
be resized as well to reflect the growth.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qcow2-cluster.c