feature #2092: Make use of hybrid hypervisor instead of attribute

This commit is contained in:
Ruben S. Montero committed 2013-10-10 13:07:33 +02:00
1 parent c783b963f4
commit 38ad6cebeb
4 files changed
+26 -13

No files matched your search

+2 -6
View File
@@ -251,7 +251,7 @@ int VirtualMachine::insert(SqlDB * db, string& error_str)
string value;
int ivalue;
float fvalue;
ostringstream oss;
// ------------------------------------------------------------------------
@@ -1144,16 +1144,12 @@ int VirtualMachine::automatic_requirements(string& error_str)
}
}
static_cast<VirtualMachineTemplate*>(obj_template)->get_hybrid_hypervisor(
hypervisor);
oss.str("");
if ( !cluster_id.empty() )
{
oss << "CLUSTER_ID = " << cluster_id;
}
if ( !hypervisor.empty() )
if (static_cast<VirtualMachineTemplate*>(obj_template)->get_hybrid_hypervisor(hypervisor))
{
if ( !cluster_id.empty() )
{
+3 -2
View File
@@ -15,6 +15,7 @@
/* -------------------------------------------------------------------------- */
#include "VirtualMachineTemplate.h"
#include "Host.h"
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
@@ -151,10 +152,10 @@ bool VirtualMachineTemplate::get_hybrid_hypervisor(string& hypervisor) const
bool found_it = false;
for(int i=0; i < NUM_HYBRID_ATTRIBUTES; i++)
{
{
if(get(HYBRID_ATTRIBUTES[i],attrs))
{
hypervisor = HYBRID_ATTRIBUTES[i];
hypervisor = Host::get_hybrid_hypervisor_by_id(i);
found_it = true;
break;
}