1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-02 09:47:00 +03:00

feature #3782: Removed unused method

This commit is contained in:
Ruben S. Montero 2015-06-30 13:12:30 +02:00
parent 6ca1ff4b6e
commit 282a813d9a
2 changed files with 0 additions and 134 deletions

View File

@ -360,29 +360,6 @@ private:
write_drv("SNAPSHOTDELETE", oid, drv_msg);
}
/**
* Gets VM information from the driver answer
* @param monitor_str from the driver
* @param memory Kilobytes used by the VM (total)
* @param cpu used by the VM (rate)
* @param net_tx transmitted bytes (total)
* @param net_rx received bytes (total)
* @param disk_actual actual disk usage for VM (total mb)
* @param disk_virtual virtual disk usage for VM (total mb)
* @param state of the vm
* @param custom monitor information
*/
static int parse_vm_info(
const string& monitor_str,
int &cpu,
int &memory,
long long &net_tx,
long long &net_rx,
long long &disk_actual,
long long &disk_virtual,
char &state,
map<string,string> &custom);
/**
*
*/

View File

@ -707,117 +707,6 @@ void VirtualMachineManagerDriver::process_poll(
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
int VirtualMachineManagerDriver::parse_vm_info(
const string &monitor_str,
int &cpu,
int &memory,
long long &net_tx,
long long &net_rx,
long long &disk_actual,
long long &disk_virtual,
char &state,
map<string,string> &custom)
{
istringstream is;
int parse_result = 0;
size_t pos;
string tmp;
string var;
ostringstream os;
istringstream tiss;
cpu = -1;
memory = -1;
net_tx = -1;
net_rx = -1;
state = '-';
disk_actual = -1;
disk_virtual = -1;
custom.clear();
is.str(monitor_str);
while(parse_result == 0 && is.good())
{
is >> tmp >> ws;
pos = tmp.find('=');
if ( pos == string::npos )
{
parse_result = -1;
continue;
}
tmp.replace(pos,1," ");
tiss.clear();
tiss.str(tmp);
tiss >> var >> ws;
if (!tiss.good())
{
parse_result = -1;
continue;
}
if (var == "USEDMEMORY")
{
tiss >> memory;
}
else if (var == "USEDCPU")
{
tiss >> fixed >> cpu;
}
else if (var == "NETRX")
{
tiss >> net_rx;
}
else if (var == "NETTX")
{
tiss >> net_tx;
}
else if (var == "STATE")
{
tiss >> state;
}
else if (var == "DISK_ACTUAL_SIZE")
{
tiss >> disk_actual;
}
else if (var == "DISK_VIRTUAL_SIZE")
{
tiss >> disk_virtual;
}
else if (!var.empty())
{
string val;
tiss >> val;
custom.insert(make_pair(var, val));
}
if (tiss.fail())
{
parse_result = -1;
continue;
}
}
return parse_result;
}
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
void VirtualMachineManagerDriver::recover()
{
NebulaLog::log("VMM",Log::INFO,"Recovering VMM drivers");