[libvirt] [PATCH] qemu: qemuDomainRename and virDomainObjListNumOfDomains ABBA deadlock fix

Maxim Nestratov mnestratov at virtuozzo.com
Tue Jan 26 13:52:34 UTC 2016


26.01.2016 16:33, Martin Kletzander пишет:
> On Tue, Jan 26, 2016 at 02:14:23PM +0100, Jiri Denemark wrote:
>> On Tue, Jan 26, 2016 at 13:26:32 +0100, Michal Privoznik wrote:
>>> On 25.01.2016 10:16, Maxim Nestratov wrote:
>> ...
[snip]
>>> What if, instead of introducing bunch of Locked() functions we 
>>> introduce
>>> a new internal API to virDomainObjList that will look like this:
>>>
>>> int virDomainObjListRename(virDomainObjListPtr domains,
>>>                            virDomainObjPtr dom,
>>>                            const char *new_name,
>>>                            int (*driverRename)(virDomainObjPtr, ...),
>>>                            int (*rollBack)(virDomainObjPtr, ...));
>>>
>>> This function will encapsulate the renaming and at the correct spot it
>>> will call driverRename() so that driver can adjust its internal state.
>>> If the driver is successful, just remove the old entry. If it is not,
>>> call rollBack() callback which will cancel partially performed 
>>> operation
>>> and restore original state of the driver.
>>> Moreover, in the virDomainObjListRename() we can ensure the locking
>>> order and we don't need to introduce new BeginJob() API with no 
>>> timeout.
>>
>> But very much this approach I like :-)
>>
>
> That's what I meant with:
>  "Or the other way would be moving parts of the rename code into this 
> file
>   to make it available for other drivers as well."
>
> but you explained it in more detail and understandably.  ACK for that
> idea as well.
>
I like it too. I can rework the patch following this way if no one wants 
to volunteer.

>> Jirka
>>
>> -- 
>> libvir-list mailing list
>> libvir-list at redhat.com
>> https://www.redhat.com/mailman/listinfo/libvir-list




More information about the libvir-list mailing list