mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-09 05:27:20 +09:00
Revert "Bug #3700: Transition from poff->runn requires the VM to be reported twice"
This reverts commit ea876146af.
This commit is contained in:
1 parent
ea876146af
commit
dd8dbb38b5
3 files changed
+3
-41
No files matched your search
@@ -165,7 +165,6 @@ public:
|
||||
bool &with_vm_info,
|
||||
set<int> &lost,
|
||||
map<int,string> &found,
|
||||
set<int> &found_twice,
|
||||
const set<int> &non_shared_ds,
|
||||
long long reserved_cpu,
|
||||
long long reserved_mem);
|
||||
@@ -528,12 +527,6 @@ private:
|
||||
*/
|
||||
set<int> tmp_zombie_vms;
|
||||
|
||||
/**
|
||||
* Tmp set of found VM IDs. Used to give recovered poweroff VMs one
|
||||
* grace cycle, in case they reappear in outdated poll info.
|
||||
*/
|
||||
set<int> tmp_found_vms;
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// VM Collection
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
@@ -248,7 +248,6 @@ int Host::update_info(Template &tmpl,
|
||||
bool &with_vm_info,
|
||||
set<int> &lost,
|
||||
map<int,string> &found,
|
||||
set<int> &found_twice,
|
||||
const set<int> &non_shared_ds,
|
||||
long long reserved_cpu,
|
||||
long long reserved_mem)
|
||||
@@ -272,7 +271,6 @@ int Host::update_info(Template &tmpl,
|
||||
|
||||
set<int> prev_tmp_lost = tmp_lost_vms;
|
||||
set<int> prev_tmp_zombie = tmp_zombie_vms;
|
||||
set<int> prev_tmp_found = tmp_found_vms;
|
||||
|
||||
int num_zombies = 0;
|
||||
int num_wilds = 0;
|
||||
@@ -339,8 +337,6 @@ int Host::update_info(Template &tmpl,
|
||||
|
||||
tmp_zombie_vms.clear();
|
||||
|
||||
tmp_found_vms.clear();
|
||||
|
||||
for (it = vm_att.begin(); it != vm_att.end(); it++)
|
||||
{
|
||||
vatt = dynamic_cast<VectorAttribute*>(*it);
|
||||
@@ -366,13 +362,6 @@ int Host::update_info(Template &tmpl,
|
||||
if (tmp_lost_vms.erase(vmid) == 1) //Good, known
|
||||
{
|
||||
found.insert(make_pair(vmid, vatt->vector_value("POLL")));
|
||||
|
||||
tmp_found_vms.insert(vmid);
|
||||
|
||||
if (prev_tmp_found.count(vmid) == 1)
|
||||
{
|
||||
found_twice.insert(vmid);
|
||||
}
|
||||
}
|
||||
else //Bad, known but should not be here
|
||||
{
|
||||
|
||||
+3
-23
@@ -184,7 +184,6 @@ void MonitorThread::do_message()
|
||||
|
||||
set<int> lost;
|
||||
map<int,string> found;
|
||||
set<int> found_twice;
|
||||
|
||||
ostringstream oss;
|
||||
|
||||
@@ -195,8 +194,8 @@ void MonitorThread::do_message()
|
||||
return;
|
||||
}
|
||||
|
||||
rc = host->update_info(tmpl, vm_poll, lost, found, found_twice,
|
||||
non_shared_ds, reserved_cpu, reserved_mem);
|
||||
rc = host->update_info(tmpl, vm_poll, lost, found, non_shared_ds,
|
||||
reserved_cpu, reserved_mem);
|
||||
|
||||
hpool->update(host);
|
||||
|
||||
@@ -253,26 +252,7 @@ void MonitorThread::do_message()
|
||||
|
||||
for (itm = found.begin(); itm != found.end(); itm++)
|
||||
{
|
||||
VirtualMachine * vm = vmpool->get(itm->first, true);
|
||||
|
||||
if (vm == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// When a VM in poweroff is found again, it may be because of
|
||||
// outdated poll information. To make sure, we check if VM was
|
||||
// reported twice
|
||||
if (vm->get_state() == VirtualMachine::POWEROFF &&
|
||||
found_twice.count(itm->first) == 0)
|
||||
{
|
||||
vm->unlock();
|
||||
continue;
|
||||
}
|
||||
|
||||
VirtualMachineManagerDriver::process_poll(vm, itm->second);
|
||||
|
||||
vm->unlock();
|
||||
VirtualMachineManagerDriver::process_poll(itm->first, itm->second);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user