1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-22 13:33:52 +03:00

feature #1288: get, string version, for VirtualMachinePool

This commit is contained in:
Ruben S. Montero 2012-06-01 11:58:47 +02:00
parent 20969b3375
commit 0d9a4c998a

View File

@ -75,6 +75,26 @@ public:
return static_cast<VirtualMachine *>(PoolSQL::get(oid,lock));
};
/**
* Function to get a VM from the pool, string version for VM ID
*/
VirtualMachine * get(
const string& oid_s,
bool lock)
{
istringstream iss(oid_s);
int oid;
iss >> oid;
if ( iss.fail() )
{
return 0;
}
return static_cast<VirtualMachine *>(PoolSQL::get(oid,lock));
};
/**
* Function to get the IDs of running VMs
* @param oids a vector that contains the IDs