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

Michal Privoznik mprivozn at redhat.com
Mon Feb 1 12:43:20 UTC 2016


On 01.02.2016 10:33, Nikolay Shirokovskiy wrote:
> A pretty nasty deadlock occurs while trying to rename a VM in parallel
> with virDomainObjListNumOfDomains.
> The short description of the problem is as follows:
> 
> Thread #1:
> 
> qemuDomainRename:
>     ------> aquires domain lock by qemuDomObjFromDomain
>        ---------> waits for domain list lock in any of the listed functions:
>           - virDomainObjListFindByName
>           - virDomainObjListRenameAddNew
>           - virDomainObjListRenameRemove
> 
> Thread #2:
> 
> virDomainObjListNumOfDomains:
>     ------> aquires domain list lock
>        ---------> waits for domain lock in virDomainObjListCount
> 
> Introduce generic virDomainObjListRename function for renaming domains.
> It aquires list lock in right order to avoid deadlock. Callback is used
> to make driver specific domain updates.
> 
> Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy at virtuozzo.com>
> ---
>  src/conf/virdomainobjlist.c |  98 +++++++++++++++++++-----------
>  src/conf/virdomainobjlist.h |  16 +++--
>  src/libvirt_private.syms    |   3 +-
>  src/qemu/qemu_driver.c      | 142 ++++++++++++++++++++------------------------
>  4 files changed, 142 insertions(+), 117 deletions(-)

Looking good. ACK. But I rather wait couple of moments in case others
would like to express their feelings.

Michal




More information about the libvir-list mailing list