From 83c1b9d993bc76bbecd4c40b1c0f9592709cc5f4 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Wed, 9 Jun 2010 19:47:22 +0200 Subject: [PATCH] bug : solved potential deadlock in VM manager --- src/vmm/VirtualMachineManager.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/vmm/VirtualMachineManager.cc b/src/vmm/VirtualMachineManager.cc index e28e15b44f..729c53655a 100644 --- a/src/vmm/VirtualMachineManager.cc +++ b/src/vmm/VirtualMachineManager.cc @@ -830,12 +830,18 @@ void VirtualMachineManager::timer_action() { vm = vmpool->get(*it,true); - if ( vm == 0 || (!vm->hasHistory())) + if ( vm == 0 ) + { + continue; + } + + if (!vm->hasHistory()) { os.str(""); os << "Monitoring VM " << *it << " but it has no history."; NebulaLog::log("VMM", Log::ERROR, os); + vm->unlock(); continue; }