On 15/1/2019 6:27 PM, Alberto Garcia wrote:
> On Mon 14 Jan 2019 12:18:30 PM CET, Anton Nefedov wrote:
>> If COW areas of the newly allocated clusters are zeroes on the backing image,
>> efficient bdrv_write_zeroes(flags=BDRV_REQ_ALLOCATE) can be used on the whole
>> cluster instead of writing explicit zero buffers later in perform_cow().
>>
>> iotest 060:
>> write to the discarded cluster does not trigger COW anymore.
>> Use a backing image instead.
>>
>> Signed-off-by: Anton Nefedov <[email protected]>
>> Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]>
>
> Reviewed-by: Alberto Garcia <[email protected]>
>
>> + ret = handle_alloc_space(bs, l2meta);
>
> I insist that it would be nice to have a short comment explaining what
> this does.
>
Right sorry forgot your comment.
I'd go with:
+ /* Try to efficiently initialize the physical space with zeroes */
ret = handle_alloc_space(bs, l2meta);
if (ret < 0) {
qemu_co_mutex_lock(&s->lock);