mirror of
https://github.com/OpenNebula/one.git
synced 2025-02-02 09:47:00 +03:00
feature #3781: Parse disk_*_size from monitor driver
This commit is contained in:
parent
dfdbc516d1
commit
552e6a8f96
@ -367,6 +367,8 @@ private:
|
||||
* @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
|
||||
*/
|
||||
@ -376,6 +378,8 @@ private:
|
||||
int &memory,
|
||||
long long &net_tx,
|
||||
long long &net_rx,
|
||||
long long &disk_actual,
|
||||
long long &disk_virtual,
|
||||
char &state,
|
||||
map<string,string> &custom);
|
||||
|
||||
|
@ -602,6 +602,8 @@ void VirtualMachineManagerDriver::process_poll(
|
||||
int memory;
|
||||
long long net_tx;
|
||||
long long net_rx;
|
||||
long long dactual;
|
||||
long long dvirtual;
|
||||
char state;
|
||||
|
||||
map<string, string> custom;
|
||||
@ -616,7 +618,8 @@ void VirtualMachineManagerDriver::process_poll(
|
||||
/* Parse VM info */
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
rc = parse_vm_info(monitor_str, cpu, memory, net_tx, net_rx, state, custom);
|
||||
rc = parse_vm_info(monitor_str, cpu, memory, net_tx, net_rx, dactual,
|
||||
dvirtual, state, custom);
|
||||
|
||||
if (rc == -1) //Parse error, ignore this monitor data
|
||||
{
|
||||
@ -724,6 +727,8 @@ int VirtualMachineManagerDriver::parse_vm_info(
|
||||
int &memory,
|
||||
long long &net_tx,
|
||||
long long &net_rx,
|
||||
long long &disk_actual,
|
||||
long long &disk_virtual,
|
||||
char &state,
|
||||
map<string,string> &custom)
|
||||
{
|
||||
@ -744,6 +749,9 @@ int VirtualMachineManagerDriver::parse_vm_info(
|
||||
net_rx = -1;
|
||||
state = '-';
|
||||
|
||||
disk_actual = -1;
|
||||
disk_virtual = -1;
|
||||
|
||||
custom.clear();
|
||||
|
||||
is.str(monitor_str);
|
||||
@ -794,6 +802,14 @@ int VirtualMachineManagerDriver::parse_vm_info(
|
||||
{
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user