On 09/06/2012 05:16 PM, Eric Blake wrote: > On 09/06/2012 02:37 PM, Jeff Cody wrote: >> On 09/06/2012 10:00 AM, Kevin Wolf wrote: >>> Am 30.08.2012 20:47, schrieb Jeff Cody: >>>> This adds the live commit coroutine. This iteration focuses on the >>>> commit only below the active layer, and not the active layer itself. >>>> >>>> The behaviour is similar to block streaming; the sectors are walked >>>> through, and anything that exists above 'base' is committed back down >>>> into base. At the end, intermediate images are deleted, and the >>>> chain stitched together. Images are restored to their original open >>>> flags upon completion. >>>> > >> >>> What should we do with backing files that are smaller than the image to >>> commit? In this version, data is copied up to the size of the backing >>> file, and then we get -EIO from bdrv_co_do_writev(). >>> >> >> We could leave it like that, and let it receive -EIO in that case. >> Alternatively, we could try and determine before the commit if the data >> will fit in the base, and return -ENOSPC if not. > > Neither sounds appealing. Why can't we first try to resize the base to > the new data size being committed, and only fall back to -ENOSPC or -EIO > if the resize fails? >
OK - we will attempt to resize the base, and return the appropriate error on failure or if unsupported for the format.