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:
parent
20969b3375
commit
0d9a4c998a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user