1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

Bug #1609: Poweroff action creates a new history entry

This commit is contained in:
Carlos Martín 2012-11-07 17:09:05 +01:00
parent b3bf623670
commit 627058c341

View File

@ -532,11 +532,21 @@ void LifeCycleManager::restart_action(int vid)
}
else // if ( vm->get_state() == VirtualMachine::POWEROFF )
{
time_t the_time = time(0);
vm->set_state(VirtualMachine::ACTIVE); // Only needed by poweroff
vm->set_state(VirtualMachine::BOOT_POWEROFF);
vm->cp_history();
vmpool->update(vm);
vm->set_stime(the_time);
vm->set_running_stime(the_time);
vmpool->update_history(vm);
vm->log("LCM", Log::INFO, "New VM state is BOOT_POWEROFF");
}