block: resize backing file image during offline commit, if necessary
authorJeff Cody <jcody@redhat.com>
Fri, 24 Jan 2014 14:02:35 +0000 (09:02 -0500)
committerKevin Wolf <kwolf@redhat.com>
Fri, 24 Jan 2014 15:12:49 +0000 (16:12 +0100)
commit72706ea4cd38bfcb151265df0178ba21863d7518
tree04bf2e6b37e64cc9d7f3e7bf1e4e277dd55fa216
parent031fd1be5618c347f9aeb44ec294f14a541e42b2
block: resize backing file image during offline commit, if necessary

Currently, if an image file is logically larger than its backing file,
committing it via 'qemu-img commit' will fail.

For instance, if we have a base image with a virtual size 10G, and a
snapshot image of size 20G, then committing the snapshot offline with
'qemu-img commit' will likely fail.

This will automatically attempt to resize the base image, if the
snapshot image to be committed is larger.

Signed-off-by: Jeff Cody <jcody@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Benoit Canet <benoit@irqsave.net>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c