From: Daniel P. Berrange Date: Mon, 11 Feb 2013 16:45:50 +0000 (+0000) Subject: Release VM lock before acquiring virDomainObjListPtr lock X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d1c7b00b60a4e4fa3d336a945e4710a10997ded0;p=libvirt.git Release VM lock before acquiring virDomainObjListPtr lock When removing a VM from the virDomainObjListPtr, we must not be holding the VM lock while acquiring the list lock. Re-order code to ensure that we can release the VM lock early. --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 1c925f0914..7a2b012fd9 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -2116,11 +2116,10 @@ void virDomainObjListRemove(virDomainObjListPtr doms, { char uuidstr[VIR_UUID_STRING_BUFLEN]; - virObjectLock(doms); virUUIDFormat(dom->def->uuid, uuidstr); - virObjectUnlock(dom); + virObjectLock(doms); virHashRemoveEntry(doms->objs, uuidstr); virObjectUnlock(doms); }