[PATCH v3 3/6] vz: lock driver when a new domain is created in prlsdkNewDomainByHandle

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



there can be a race with vzDomainDefineXMLFlags

Signed-off-by: Maxim Nestratov <mnestratov@xxxxxxxxxxxxx>
---
 src/vz/vz_sdk.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/vz/vz_sdk.c b/src/vz/vz_sdk.c
index db14e78..dcc2703 100644
--- a/src/vz/vz_sdk.c
+++ b/src/vz/vz_sdk.c
@@ -1257,6 +1257,7 @@ prlsdkNewDomainByHandle(vzDriverPtr driver, PRL_HANDLE sdkdom)
     if (prlsdkGetDomainIds(sdkdom, &name, uuid) < 0)
         goto cleanup;
 
+    virObjectLock(driver);
     if (!(dom = vzNewDomain(driver, name, uuid)))
         goto cleanup;
 
@@ -1267,6 +1268,7 @@ prlsdkNewDomainByHandle(vzDriverPtr driver, PRL_HANDLE sdkdom)
     }
 
  cleanup:
+    virObjectUnlock(driver);
     VIR_FREE(name);
     return dom;
 }
-- 
2.4.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]