[libvirt] [PATCH 0/4 v2] vz: rework domain creation

Mikhail Feoktistov mfeoktistov at virtuozzo.com
Thu Jan 28 15:38:08 UTC 2016


Patches 1 and 2 make preparation for patch 4

Patch 3 fixes notification subscription
To get domain info we should receive and handle notification from hypervisor

Patch 4 fixes race condition when adding domain to domains list
Race condition:
User calls defineXML to create new instance.
The main thread from vzDomainDefineXMLFlags() creates new instance by prlsdkCreateVm.
Then this thread calls prlsdkAddDomain to add new domain to domains list.
The second thread receives notification from hypervisor that new VM was created.
It calls prlsdkHandleVmAddedEvent() and also tries to add new domain to domains list.
These two threads call virDomainObjListFindByUUID() from prlsdkAddDomain() and don't find new domain.
So they add two domains with the same uuid to domains list.

Mikhail Feoktistov (4):
  vz: make output arguments in prlsdkGetDomainIds as optional
  vz: remove unused struct field
  vz: fix notification subscription
  vz: fix race condition when adding domain to domains list

 src/vz/vz_driver.c |  13 ++-
 src/vz/vz_sdk.c    | 293 +++++++++++++++++++++++++++--------------------------
 src/vz/vz_sdk.h    |   9 +-
 src/vz/vz_utils.h  |   1 -
 4 files changed, 165 insertions(+), 151 deletions(-)

-- 
1.8.3.1




More information about the libvir-list mailing list