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.
This commit is contained in:
Daniel P. Berrange 2013-02-11 16:45:50 +00:00
parent 61b52d2e38
commit d1c7b00b60

View File

@ -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);
}