On Tue, Sep 24, 2013 at 03:34:54PM +0200, Peter Lieven wrote: > this patch adds the ability for targets to stay sparse during > block migration (if the zero_blocks capability is set) and qemu-img convert > even if the target does not have has_zero_init = 1. > > the series was especially developed for iSCSI, but it should also work > with other drivers with little or no adjustments. these adjustments > should be limited to providing block provisioning information through > get_block_info and/or honouring BDRV_REQ_MAY_UNMAP on writing zeroes.
Could you make bdrv_co_write_zeroes() always use UNMAP, if possible, and avoid adding the new BDRV_REQ_MAY_UNMAP flag? While reading the first few patches in this series I wondered why there is a need to expose flags at all... Sometimes it is useful to distinguish between zeroing at the image format level from discarding at the device level, but I don't think we make use of that yet. I'd prefer to keep the interface simple for now and add flags later, if necessary. Or maybe I just missed something ;) Stefan