do not lock vm while allocating memory

There is no need to lock vm while allocating memory. If allocating
memory failed, we forgot to unlock vm.
This commit is contained in:
Wen Congyang 2011-03-30 15:46:33 +08:00 committed by Wen Congyang
parent d958874780
commit 19f916a764

View File

@ -525,8 +525,6 @@ qemuProcessHandleGraphics(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
virDomainEventGraphicsSubjectPtr subject = NULL;
int i;
virDomainObjLock(vm);
if (VIR_ALLOC(localAddr) < 0)
goto no_memory;
localAddr->family = localFamily;
@ -560,6 +558,7 @@ qemuProcessHandleGraphics(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
subject->nidentity++;
}
virDomainObjLock(vm);
event = virDomainEventGraphicsNewFromObj(vm, phase, localAddr, remoteAddr, authScheme, subject);
virDomainObjUnlock(vm);