diff --git a/include/Host.h b/include/Host.h index d327b97ce7..4503747810 100644 --- a/include/Host.h +++ b/include/Host.h @@ -92,15 +92,6 @@ public: */ bool isHybrid() const; - /** - * Return an element of the hypervisor array. The calling function - * must check that the index is valid. - */ - static const char * get_hybrid_hypervisor_by_id(int i) - { - return HYBRID_HYPERVISORS[i]; - } - /** * Disables the current host, it will not be monitored nor used by the * scheduler @@ -534,17 +525,6 @@ private: static const char * monit_table; - /** - * Array containing the hybrid hypervisors, and counter. There is a - * correspondence between Host::HYBRID_HYPERVISOR and - * VirtualMachine::HYBRID_ATTRIBUTES. Attributes in HYBRID_ATTRIBUTES[i] are - * meant to be used in hosts reporting a a hypervisor of type - * HYBRID_HYPERVISOR[i] - */ - static const char * HYBRID_HYPERVISORS[]; - - static const int NUM_HYBRID_HYPERVISORS; - /** * Execute an INSERT or REPLACE Sql query. * @param db The SQL DB diff --git a/include/VirtualMachineTemplate.h b/include/VirtualMachineTemplate.h index a30132e78e..c637f48168 100644 --- a/include/VirtualMachineTemplate.h +++ b/include/VirtualMachineTemplate.h @@ -67,30 +67,12 @@ public: */ void remove_all_except_restricted(); - /** - * Returns the hypervisor name if the template is hybrid - * @param hypervisor the resulting hypervisor string - * @return true if any hybrid hypervisor attribute found, false otherwise - */ - bool get_hybrid_hypervisor(string& hypervisor) const; - private: friend class VirtualMachinePool; static vector restricted_attributes; - /** - * Array containing the hybrid attributes, and counter. There is a - * correspondence between Host::HYBRID_HYPERVISOR and - * VirtualMachine::HYBRID_ATTRIBUTES. Attributes in HYBRID_ATTRIBUTES[i] are - * meant to be used in hosts reporting a a hypervisor of type - * HYBRID_HYPERVISOR[i] - */ - static const char * HYBRID_ATTRIBUTES[]; - - static const int NUM_HYBRID_ATTRIBUTES; - /** * Stores the attributes as restricted, these attributes will be used in * VirtualMachineTemplate::check diff --git a/src/host/Host.cc b/src/host/Host.cc index 8f0231d335..3d0ec4d40e 100644 --- a/src/host/Host.cc +++ b/src/host/Host.cc @@ -23,13 +23,6 @@ #include "Host.h" #include "Nebula.h" -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ - -const char * Host::HYBRID_HYPERVISORS[] = {"EC2"}; - -const int Host::NUM_HYBRID_HYPERVISORS = 1; - /* ************************************************************************ */ /* Host :: Constructor/Destructor */ /* ************************************************************************ */ diff --git a/src/scheduler/src/sched/Scheduler.cc b/src/scheduler/src/sched/Scheduler.cc index 7eb46f1fa3..cf62aeea5d 100644 --- a/src/scheduler/src/sched/Scheduler.cc +++ b/src/scheduler/src/sched/Scheduler.cc @@ -390,7 +390,7 @@ void Scheduler::match_schedule() int oid; int uid; int gid; - int n_hosts; + int n_resources; int n_matched; int n_auth; int n_error; @@ -427,7 +427,7 @@ void Scheduler::match_schedule() vm->get_requirements(vm_cpu,vm_memory,vm_disk); - n_hosts = 0; + n_resources = 0; n_matched = 0; n_auth = 0; n_error = 0; @@ -577,7 +577,7 @@ void Scheduler::match_schedule() { vm->add_match_host(host->get_hid()); - n_hosts++; + n_resources++; } else { @@ -594,7 +594,7 @@ void Scheduler::match_schedule() // Log scheduling errors to VM user if any // --------------------------------------------------------------------- - if (n_hosts == 0) //No hosts assigned, let's see why + if (n_resources == 0) //No hosts assigned, let's see why { if (n_error == 0) //No syntax error { @@ -654,7 +654,7 @@ void Scheduler::match_schedule() ds_reqs = vm->get_ds_requirements(); - n_hosts = 0; + n_resources = 0; n_matched = 0; n_error = 0; @@ -719,7 +719,7 @@ void Scheduler::match_schedule() { vm->add_match_datastore(ds->get_oid()); - n_hosts++; + n_resources++; } else { @@ -737,7 +737,7 @@ void Scheduler::match_schedule() // capacity will be checked later for each host vm->add_match_datastore(ds->get_oid()); - n_hosts++; + n_resources++; } } @@ -745,7 +745,7 @@ void Scheduler::match_schedule() // Log scheduling errors to VM user if any // --------------------------------------------------------------------- - if (n_hosts == 0) + if (n_resources == 0) { // For a hybrid VM, 0 system DS is not a problem if (vm->isHybrid()) diff --git a/src/vm/VirtualMachineTemplate.cc b/src/vm/VirtualMachineTemplate.cc index 6504727a17..fee5310290 100644 --- a/src/vm/VirtualMachineTemplate.cc +++ b/src/vm/VirtualMachineTemplate.cc @@ -22,14 +22,6 @@ vector VirtualMachineTemplate::restricted_attributes; -/* ************************************************************************ */ -/* Hybrid Attributes */ -/* ************************************************************************ */ - -const char * VirtualMachineTemplate::HYBRID_ATTRIBUTES[] = {"EC2"}; - -const int VirtualMachineTemplate::NUM_HYBRID_ATTRIBUTES = 1; - /* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */ @@ -143,23 +135,3 @@ void VirtualMachineTemplate::remove_all_except_restricted() set(*res_it); } } -/* -------------------------------------------------------------------------- */ -/* -------------------------------------------------------------------------- */ - -bool VirtualMachineTemplate::get_hybrid_hypervisor(string& hypervisor) const -{ - vector attrs; - bool found_it = false; - - for(int i=0; i < NUM_HYBRID_ATTRIBUTES; i++) - { - if(get(HYBRID_ATTRIBUTES[i],attrs)) - { - hypervisor = Host::get_hybrid_hypervisor_by_id(i); - found_it = true; - break; - } - } - - return found_it; -}