qemu-e2k/block
Stefan Hajnoczi 419b19d9b4 qcow2: Implement bdrv_truncate() for growing images
This patch adds the ability to grow qcow2 images in-place using
bdrv_truncate().  This enables qemu-img resize command support for
qcow2.

Snapshots are not supported and bdrv_truncate() will return -ENOTSUP.
The notion of resizing an image with snapshots could lead to confusion:
users may expect snapshots to remain unchanged, but this is not possible
with the current qcow2 on-disk format where the header.size field is
global instead of per-snapshot.  Others may expect snapshots to change
size along with the current image data.  I think it is safest to not
support snapshots and perhaps add behavior later if there is a
consensus.

Backing images continue to work.  If the image is now larger than its
backing image, zeroes are read when accessing beyond the end of the
backing image.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2010-05-03 10:07:32 +02:00
..
blkdebug.c block: Open the underlying image file in generic code 2010-05-03 10:07:30 +02:00
bochs.c block: Open the underlying image file in generic code 2010-05-03 10:07:30 +02:00
cloop.c block: Open the underlying image file in generic code 2010-05-03 10:07:30 +02:00
cow.c block: Open the underlying image file in generic code 2010-05-03 10:07:30 +02:00
curl.c block: Open the underlying image file in generic code 2010-05-03 10:07:30 +02:00
dmg.c block: Open the underlying image file in generic code 2010-05-03 10:07:30 +02:00
nbd.c block: Open the underlying image file in generic code 2010-05-03 10:07:30 +02:00
parallels.c block: Open the underlying image file in generic code 2010-05-03 10:07:30 +02:00
qcow2-cluster.c block: Open the underlying image file in generic code 2010-05-03 10:07:30 +02:00
qcow2-refcount.c qcow2: Remove abort on free_clusters failure 2010-05-03 10:07:32 +02:00
qcow2-snapshot.c block: Open the underlying image file in generic code 2010-05-03 10:07:30 +02:00
qcow2.c qcow2: Implement bdrv_truncate() for growing images 2010-05-03 10:07:32 +02:00
qcow2.h qcow2: Implement bdrv_truncate() for growing images 2010-05-03 10:07:32 +02:00
qcow.c block: Open the underlying image file in generic code 2010-05-03 10:07:30 +02:00
raw-posix-aio.h Remove aio_ctx from paio_* interface 2009-10-30 08:39:34 -05:00
raw-posix.c raw-posix: Use pread/pwrite instead of lseek+read/write 2010-05-03 10:07:31 +02:00
raw-win32.c block: Open the underlying image file in generic code 2010-05-03 10:07:30 +02:00
raw.c block: Open the underlying image file in generic code 2010-05-03 10:07:30 +02:00
vdi.c block: Open the underlying image file in generic code 2010-05-03 10:07:30 +02:00
vmdk.c vmdk: Convert to bdrv_open 2010-05-03 10:07:31 +02:00
vpc.c block: Open the underlying image file in generic code 2010-05-03 10:07:30 +02:00
vvfat.c block: Open the underlying image file in generic code 2010-05-03 10:07:30 +02:00