OSDN Git Service

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)
commitd191d12d5f479422e16ed1d12b0222547b29036a
treedafeb368cfc86e2a8b7d69100a5d167fc363febd
parentb4558d7481aefc865b0b52bf9b285ebcf2e8b59f
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