From 045176bf35f5012d15dad60909a3de7a6d270f44 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Fri, 10 Jul 2009 12:56:12 -0400 Subject: [PATCH] storage: Fix deadlock when cloning across pools. 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 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/storage_driver.c b/src/storage_driver.c index c27534c986..e9ecb20413 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);