]> xenbits.xensource.com Git - libvirt.git/commitdiff
Release VM lock before acquiring virDomainObjListPtr lock
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 11 Feb 2013 16:45:50 +0000 (16:45 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 12 Feb 2013 11:06:03 +0000 (11:06 +0000)
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.

src/conf/domain_conf.c

index 1c925f091430c1cfda02ae61ab20b9bb380ce2a2..7a2b012fd9f196ebfd725020f4fba344f46f3a30 100644 (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);
 }