qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH 03/18] mirror: use bdrv_drained_begin/bdrv_drain


From: Paolo Bonzini
Subject: Re: [Qemu-block] [PATCH 03/18] mirror: use bdrv_drained_begin/bdrv_drained_end
Date: Fri, 14 Oct 2016 12:00:18 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0


On 14/10/2016 11:43, Fam Zheng wrote:
> On Thu, 10/13 19:34, Paolo Bonzini wrote:
>> Ensure that there are no changes between the last check to
>> bdrv_get_dirty_count and the switch to the target.
>>
>> There is already a bdrv_drained_end call, we only need to ensure
>> that bdrv_drained_begin is not called twice.
>>
>> Cc: address@hidden
> 
> Cc stable? I don't see an existing bug here, can you explain?

Hmm, I was not sure that mirror was safe for dataplane devices without
the drained section, but it looks like there is no "hole".  So no need
to Cc stable.

>> @@ -802,9 +812,10 @@ immediate_exit:
>>  
>>      data = g_malloc(sizeof(*data));
>>      data->ret = ret;
>> -    /* Before we switch to target in mirror_exit, make sure data doesn't
>> -     * change. */
>> -    bdrv_drained_begin(bs);
>> +
>> +    if (need_drain) {
> 
> Not sure whether this if block is necessary (i.e. when !(cnt == 0 &&
> should_complete)), but it certainly doesn't hurt.

Yes, the alternative is to have something similar, to skip the
bdrv_drained_end, in mirror_exit.

Paolo

>> +        bdrv_drained_begin(bs);
>> +    }
>>      block_job_defer_to_main_loop(&s->common, mirror_exit, data);
>>  }
>>  
>> -- 
>> 2.7.4
>>
>>
> 
> Fam
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]