From: Daniel P. Berrange Date: Thu, 12 Nov 2009 14:13:33 +0000 (+0000) Subject: Fix incorrect variable passed to LXC event callback X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=007f016b2df8f5df8fffd66a35656cdfae784bb1;p=libvirt.git 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 --- diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index d0fc01a316..138c6fc04c 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -942,7 +942,8 @@ static void lxcMonitorEvent(int watch, } cleanup: - virDomainObjUnlock(vm); + if (vm) + virDomainObjUnlock(vm); if (event) { lxcDriverLock(driver); lxcDomainEventQueue(driver, event); @@ -1226,7 +1227,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; }