1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-26 06:50:09 +03:00

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

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

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.");

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();