[PATCH] do not lock vm while allocating memory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



There is no need to lock vm while allocating memory. If allocating
memory failed, we forgot to unlock vm.

---
 src/qemu/qemu_process.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index e31e1b4..e74e0f1 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -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);
 
-- 
1.7.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]