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

[libvirt] [PATCH 4/5] Fix incorrect variable passed to LXC event callback



The wrong variable was being passed in with the LXC event callback
resulting in a later deadlock or crash

* src/lxc/lxc_driver.c: Pass 'vm' instead of 'driver' to event
  callback
---
 src/lxc/lxc_driver.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 2baff65..7c78df2 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -941,7 +941,8 @@ static void lxcMonitorEvent(int watch,
     }
 
 cleanup:
-    virDomainObjUnlock(vm);
+    if (vm)
+        virDomainObjUnlock(vm);
     if (event) {
         lxcDriverLock(driver);
         lxcDomainEventQueue(driver, event);
@@ -1225,7 +1226,7 @@ static int lxcVmStart(virConnectPtr conn,
              vm->monitor,
              VIR_EVENT_HANDLE_ERROR | VIR_EVENT_HANDLE_HANGUP,
              lxcMonitorEvent,
-             driver, NULL)) < 0) {
+             vm, NULL)) < 0) {
         lxcVmTerminate(conn, driver, vm, 0);
         goto cleanup;
     }
-- 
1.6.2.5


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