Revision 675d9367 src/dm/DispatchManagerStates.cc

View differences:

src/dm/DispatchManagerStates.cc
98 98
/* -------------------------------------------------------------------------- */
99 99
/* -------------------------------------------------------------------------- */
100 100

  
101
void  DispatchManager::shutdown_save_success_action(int vid)
102
{
103
    VirtualMachine *    vm;
104

  
105
    vm = vmpool->get(vid,true);
106

  
107
    if ( vm == 0 )
108
    {
109
        return;
110
    }
111

  
112
    // TODO: prolog_resume, or new prolog?
113

  
114
    if ((vm->get_state() == VirtualMachine::ACTIVE) &&
115
        (vm->get_lcm_state() == VirtualMachine::EPILOG_SHUTDOWN_SAVE ||
116
        vm->get_lcm_state() == VirtualMachine::PROLOG_RESUME))
117
    {
118
        vm->set_state(VirtualMachine::SHUTDOWN_SAVED);
119

  
120
        vm->set_state(VirtualMachine::LCM_INIT);
121

  
122
        vmpool->update(vm);
123

  
124
        vm->log("DiM", Log::INFO, "New VM state is SHUTDOWN_SAVED");
125
    }
126
    else
127
    {
128
        ostringstream oss;
129

  
130
        oss << "shutdown_save_success action received but VM " << vid
131
            << " not in ACTIVE state";
132
        NebulaLog::log("DiM",Log::ERROR,oss);
133
    }
134

  
135
    vm->unlock();
136

  
137
    return;
138
}
139

  
140
/* -------------------------------------------------------------------------- */
141
/* -------------------------------------------------------------------------- */
142

  
101 143
void  DispatchManager::poweroff_success_action(int vid)
102 144
{
103 145
    VirtualMachine *    vm;

Also available in: Unified diff