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.
This commit is contained in:
Cole Robinson 2009-07-10 12:56:12 -04:00
parent a500d73ac0
commit 045176bf35

View File

@ -1327,9 +1327,11 @@ storageVolumeCreateXMLFrom(virStoragePoolPtr obj,
storageDriverLock(driver); storageDriverLock(driver);
pool = virStoragePoolObjFindByUUID(&driver->pools, obj->uuid); pool = virStoragePoolObjFindByUUID(&driver->pools, obj->uuid);
if (diffpool) if (diffpool) {
virStoragePoolObjUnlock(pool);
origpool = virStoragePoolObjFindByName(&driver->pools, vobj->pool); origpool = virStoragePoolObjFindByName(&driver->pools, vobj->pool);
else virStoragePoolObjLock(pool);
} else
origpool = pool; origpool = pool;
storageDriverUnlock(driver); storageDriverUnlock(driver);