Re: [PATCH 2/2] qemu: don't needlessly unset close callback during perform phase

2020-11-06 Thread Nikolay Shirokovskiy



On 06.11.2020 17:03, Jiri Denemark wrote:
> On Tue, Aug 18, 2020 at 13:26:36 +0300, Nikolay Shirokovskiy wrote:
>> During API call connection is referenced and close callback is called when
>> connection is disposed. Thus during API call close callback cannot be 
>> triggered
>> and we don't need to unset callback on API call duration.
>>
>> This code was added in [1] and commit does not explain this part of the
>> patch.
>>
>> [1] 1fdc53c3: qemu: Avoid dangling migration-out job when client dies
> 
> I suspect this was not the case 8 years ago when close callbacks were
> introduced. In any case, I don't think calling Unset in the begining of
> qemuMigrationSrcPerformPhase and Set at the end could cause any harm.
> The idea is to keep the callback set only when there's no running API.
> So while it may not be needed, I don't think there's a real need to
> change it.
> 
> Jirka
> 

Ok, thank you for review! First patch pushed with suggested changes.

Nikolay



Re: [PATCH 2/2] qemu: don't needlessly unset close callback during perform phase

2020-11-06 Thread Jiri Denemark
On Tue, Aug 18, 2020 at 13:26:36 +0300, Nikolay Shirokovskiy wrote:
> During API call connection is referenced and close callback is called when
> connection is disposed. Thus during API call close callback cannot be 
> triggered
> and we don't need to unset callback on API call duration.
> 
> This code was added in [1] and commit does not explain this part of the
> patch.
> 
> [1] 1fdc53c3: qemu: Avoid dangling migration-out job when client dies

I suspect this was not the case 8 years ago when close callbacks were
introduced. In any case, I don't think calling Unset in the begining of
qemuMigrationSrcPerformPhase and Set at the end could cause any harm.
The idea is to keep the callback set only when there's no running API.
So while it may not be needed, I don't think there's a real need to
change it.

Jirka