qcow2: fix image creation for large, > ~2TB, images (Chris Wright)
commit7cc73776e7f8f87c9b99e021a088e7de52d268ec
authoraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 5 Apr 2009 18:16:10 +0000 (5 18:16 +0000)
committeraliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 5 Apr 2009 18:16:10 +0000 (5 18:16 +0000)
tree08b3de00f158ea91018a027bdbef9c9f1f0618fb
parent937e9a1c83cab9995778ed2037663948725b7079
qcow2: fix image creation for large, > ~2TB, images (Chris Wright)

When creating large disk images w/ qcow2 format, qcow2_create is hard
coded to creating a single refcount block.  This is insufficient for
large images, and will cause qemu-img to segfault as it walks off the
end of the refcount block.  Keep track of the space needed during image
create and create proper number of refcount blocks accordingly.

https://bugzilla.redhat.com/show_bug.cgi?id=491943

Signed-off-by: Chris Wright <chrisw@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/branches/stable_0_10@6988 c046a42c-6fe2-441c-8c8c-71466251a162
block-qcow2.c