diff --git a/include/VirtualMachinePool.h b/include/VirtualMachinePool.h index 664da7fdb6..b82087205b 100644 --- a/include/VirtualMachinePool.h +++ b/include/VirtualMachinePool.h @@ -75,6 +75,26 @@ public: return static_cast(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(PoolSQL::get(oid,lock)); + }; + /** * Function to get the IDs of running VMs * @param oids a vector that contains the IDs