Revision 1c4d369c src/vm/VirtualMachinePool.cc

View differences:

src/vm/VirtualMachinePool.cc
180 180

  
181 181
            state_hook = true;
182 182
        }
183
        else if ( on == "CUSTOM" )
184
        {
185
            VirtualMachineStateHook * hook;
186

  
187
            string lcm_str = vattr->vector_value("LCM_STATE");
188
            string vm_str  = vattr->vector_value("STATE");
189

  
190
            VirtualMachine::LcmState lcm_state;
191
            VirtualMachine::VmState vm_state;
192

  
193
            if ( VirtualMachine::lcm_state_from_str(lcm_str, lcm_state) != 0 )
194
            {
195
                ostringstream oss;
196
                oss << "Wrong LCM_STATE: "<< lcm_str <<". Hook not registered!";
197

  
198
                NebulaLog::log("VM",Log::WARNING,oss);
199
                continue;
200
            }
201

  
202
            if ( VirtualMachine::vm_state_from_str(vm_str, vm_state) != 0 )
203
            {
204
                ostringstream oss;
205
                oss << "Wrong STATE: "<< vm_str <<". Hook not registered!";
206

  
207
                NebulaLog::log("VM",Log::WARNING,oss);
208
                continue;
209
            }
210

  
211
            hook = new VirtualMachineStateHook(name, cmd, arg, remote,
212
                    lcm_state, vm_state);
213

  
214
            add_hook(hook);
215

  
216
            state_hook = true;
217
        }
183 218
        else
184 219
        {
185 220
            ostringstream oss;

Also available in: Unified diff