qcow2: Allow qcow2 disk images with size zero
authorStefan Weil <weil@mail.berlios.de>
Mon, 26 Oct 2009 15:11:16 +0000 (16:11 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 9 Nov 2009 14:43:01 +0000 (08:43 -0600)
commit5b4a6b74d0450575a99d9b9f4119f033d3ba64c9
treedafeb368cfc86e2a8b7d69100a5d167fc363febd
parenteb6a43d7c2d55ea4d483ad4a80c7d2070cabc58b
qcow2: Allow qcow2 disk images with size zero

Images with disk size 0 may be used for
VM snapshots, but not to save normal block data.

It is possible to create such images using
qemu-img, but opening them later fails.

So even "qemu-img info image.qcow2" is not
possible for an image created with
"qemu-img create -f qcow2 image.qcow2 0".

This is fixed here.

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block/qcow2-cluster.c
block/qcow2.c