feature #1404: Restart operations are done the same way. STATE and LCM_STATE are changed atomically

This commit is contained in:
Ruben S. Montero committed 2012-09-06 20:39:48 +02:00
1 parent b9a37f3930
commit 324a01dc68
2 files changed
+4 -5

No files matched your search

-2
View File
@@ -510,8 +510,6 @@ int DispatchManager::resume(
Nebula& nd = Nebula::instance();
LifeCycleManager * lcm = nd.get_lcm();
vm->set_state(VirtualMachine::ACTIVE);
vmpool->update(vm);
vm->log("DiM", Log::INFO, "New VM state is ACTIVE.");
+4 -3
View File
@@ -395,7 +395,7 @@ void LifeCycleManager::restore_action(int vid)
return;
}
if (vm->get_state() == VirtualMachine::ACTIVE)
if (vm->get_state() == VirtualMachine::SUSPENDED)
{
Nebula& nd = Nebula::instance();
VirtualMachineManager * vmm = nd.get_vmm();
@@ -406,6 +406,7 @@ void LifeCycleManager::restore_action(int vid)
//----------------------------------------------------
// BOOT STATE (FROM SUSPEND)
//----------------------------------------------------
vm->set_state(VirtualMachine::ACTIVE);
vm->set_state(VirtualMachine::BOOT);
@@ -495,10 +496,10 @@ void LifeCycleManager::restart_action(int vid)
return;
}
if ((vm->get_state() == VirtualMachine::ACTIVE &&
if ((vm->get_state() == VirtualMachine::ACTIVE &&
(vm->get_lcm_state() == VirtualMachine::UNKNOWN ||
vm->get_lcm_state() == VirtualMachine::BOOT ))
|| vm->get_state() == VirtualMachine::POWEROFF)
||vm->get_state() == VirtualMachine::POWEROFF)
{
Nebula& nd = Nebula::instance();
VirtualMachineManager * vmm = nd.get_vmm();