block: resize backing image during active layer commit, if needed
commit4da83585961631bfc10831dd26c4afda2a8b23e8
authorJeff Cody <jcody@redhat.com>
Fri, 24 Jan 2014 14:02:36 +0000 (24 09:02 -0500)
committerKevin Wolf <kwolf@redhat.com>
Fri, 24 Jan 2014 15:12:49 +0000 (24 16:12 +0100)
tree2096539ca609557c60a1867a570b11aa6a25a4d0
parent72706ea4cd38bfcb151265df0178ba21863d7518
block: resize backing image during active layer commit, if needed

If the top image to commit is the active layer, and also larger than
the base image, then an I/O error will likely be returned during
block-commit.

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

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

Signed-off-by: Jeff Cody <jcody@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/mirror.c