qcow2: Fix creation of large images
authorKevin Wolf <kwolf@redhat.com>
Fri, 26 Mar 2010 16:37:20 +0000 (17:37 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 23 Apr 2010 14:08:46 +0000 (16:08 +0200)
commit79bc7820d2aad05f68bf1681648e37a0ee2d87ed
treee58f179d9d058a2ecc892dc8dee57a3ceb378ecf
parenteabf37aece48a18c08b5a835acdb336b18920289
qcow2: Fix creation of large images

qcow_create2 assumes that the new image will only need one cluster for its
refcount table initially. Obviously that's not true any more when the image is
big enough (exact value depends on the cluster size).

This patch calculates the refcount table size dynamically.

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