Revision ca2a1a42 src/host/Host.cc

View differences:

src/host/Host.cc
253 253
    set<int>::iterator        set_it;
254 254
    map<int,string>::iterator map_it;
255 255

  
256
    set<int> prev_tmp_lost   = tmp_lost_vms;
257
    set<int> prev_tmp_zombie = tmp_zombie_vms;
256
    set<int> prev_tmp_lost   = *tmp_lost_vms;
257
    set<int> prev_tmp_zombie = *tmp_zombie_vms;
258 258

  
259 259
    int num_zombies = 0;
260 260
    int num_wilds   = 0;
......
298 298

  
299 299
    obj_template->remove("VM", vm_att);
300 300

  
301
    tmp_lost_vms = vm_collection.clone();
301
    *tmp_lost_vms = vm_collection.clone();
302 302

  
303
    tmp_zombie_vms.clear();
303
    tmp_zombie_vms->clear();
304 304

  
305 305
    for (it = vm_att.begin(); it != vm_att.end(); it++)
306 306
    {
......
328 328

  
329 329
            it_vm = found.find(vmid);
330 330

  
331
            if ( tmp_lost_vms.erase(vmid) == 1 ) //Good, known
331
            if ( tmp_lost_vms->erase(vmid) == 1 ) //Good, known
332 332
            {
333 333
                found.insert(make_pair(vmid, vatt->vector_value("POLL")));
334 334
            }
......
338 338
            }
339 339
            else //Bad, known but should not be here
340 340
            {
341
                tmp_zombie_vms.insert(vmid);
341
                tmp_zombie_vms->insert(vmid);
342 342

  
343 343
                // Reported as zombie at least 2 times?
344 344
                if (prev_tmp_zombie.count(vmid) == 1)
......
389 389
    {
390 390
        if ( one_util::regex_match("STATE=. ",map_it->second.c_str()) != 0 )
391 391
        {
392
            tmp_lost_vms.insert(map_it->first);
392
            tmp_lost_vms->insert(map_it->first);
393 393
            found.erase(map_it++);
394 394
        }
395 395
        else
......
398 398
        }
399 399
    }
400 400

  
401
    for(set_it = tmp_lost_vms.begin(); set_it != tmp_lost_vms.end(); set_it++)
401
    for(set_it = tmp_lost_vms->begin(); set_it != tmp_lost_vms->end(); set_it++)
402 402
    {
403 403
        // Reported as lost at least 2 times?
404 404
        if (prev_tmp_lost.count(*set_it) == 1)

Also available in: Unified diff