On Fri 26 May 2017 10:11:29 AM CEST, Kevin Wolf <[email protected]> wrote:
>> --- a/block/qcow2-cluster.c
>> +++ b/block/qcow2-cluster.c
>> @@ -414,6 +414,10 @@ static int coroutine_fn do_perform_cow(BlockDriverState
>> *bs,
>> struct iovec iov;
>> int ret;
>>
>> + if (bytes == 0) {
>> + return 0;
>> + }
>> +
[...]
>> +static int perform_cow(BlockDriverState *bs, QCowL2Meta *m)
>> {
>> BDRVQcow2State *s = bs->opaque;
>> + Qcow2COWRegion *start = &m->cow_start;
>> + Qcow2COWRegion *end = &m->cow_end;
>> int ret;
>>
>> - if (r->nb_bytes == 0) {
>> + if (start->nb_bytes == 0 && end->nb_bytes == 0) {
>> return 0;
>> }
>
> With this change, it can now happen that we call do_perform_cow() with
> bytes == 0.
Yes, but see the change I made to do_perform_cow() in the same patch
(quoted above).
Berto