]> xenbits.xensource.com Git - libvirt.git/commit
qemu: fix one more race on undefining and create
authorNikolay Shirokovskiy <nshirokovskiy@openvz.org>
Tue, 28 Mar 2017 09:22:14 +0000 (12:22 +0300)
committerNikolay Shirokovskiy <nshirokovskiy@openvz.org>
Wed, 13 Apr 2022 14:48:46 +0000 (17:48 +0300)
commitf647a4b8ddd2f6155c7ec1bc95c200747b72903a
tree3f7fed9654194d1035db610768a25764183dd1ea
parente55302596b5339852ccac13379cfaf83b5d0fc1c
qemu: fix one more race on undefining and create

[1] closes gap in virDomainObjListRemove so that concurrent thread can
not step in and obtain the domain while domain is temporary unlocked. But
there is another gap exist:

thread B - executes create API
thread C - executes undefine API

- thread A executes some job on domain
- threads B and C obtains domain from list and wait for job condition
- thread A finishes its job and C grabs job condition, removes domain
  from list and finishes
- thread B grabs job condition and start the domain, unfortunately
  is not in the list already

[1] commit c7d1c139ca3402e875002753952e80ce8054374e
Author: Martin Kletzander <mkletzan@redhat.com>
Date:   Thu Dec 11 11:14:08 2014 +0100

    qemu: avoid rare race when undefining domain

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@openvz.org>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_domainjob.c