[libvirt] [PATCH 9/9] storage: Fix deadlock when cloning across pools.

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

 



We need to unlock the first pool before looking up the second, since the
search locks every pool it checks.
---
 src/storage_driver.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/storage_driver.c b/src/storage_driver.c
index c27534c..e9ecb20 100644
--- a/src/storage_driver.c
+++ b/src/storage_driver.c
@@ -1327,9 +1327,11 @@ storageVolumeCreateXMLFrom(virStoragePoolPtr obj,
 
     storageDriverLock(driver);
     pool = virStoragePoolObjFindByUUID(&driver->pools, obj->uuid);
-    if (diffpool)
+    if (diffpool) {
+        virStoragePoolObjUnlock(pool);
         origpool = virStoragePoolObjFindByName(&driver->pools, vobj->pool);
-    else
+        virStoragePoolObjLock(pool);
+    } else
         origpool = pool;
     storageDriverUnlock(driver);
 
-- 
1.6.0.6

--
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]