mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-28 14:50:08 +03:00
Bug 5110 (#527): changed type for memory value to deal with >2TB hosts
This commit is contained in:
parent
23825b2c82
commit
248b750945
@ -341,7 +341,7 @@ public:
|
||||
* @param disk not used
|
||||
* @return 0 on success
|
||||
*/
|
||||
void update_capacity(int cpu, int mem, int disk)
|
||||
void update_capacity(int cpu, long int mem, int disk)
|
||||
{
|
||||
host_share.update(cpu,mem,disk);
|
||||
};
|
||||
|
@ -1021,7 +1021,7 @@ public:
|
||||
*
|
||||
* @return 0 on success
|
||||
*/
|
||||
int check_resize(float cpu, int memory, int vcpu, string& error_str);
|
||||
int check_resize(float cpu, long int memory, int vcpu, string& error_str);
|
||||
|
||||
/**
|
||||
* Resize the VM capacity
|
||||
@ -1032,7 +1032,7 @@ public:
|
||||
*
|
||||
* @return 0 on success
|
||||
*/
|
||||
int resize(float cpu, int memory, int vcpu, string& error_str);
|
||||
int resize(float cpu, long int memory, int vcpu, string& error_str);
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Virtual Machine Disks
|
||||
@ -1672,7 +1672,7 @@ private:
|
||||
/**
|
||||
* Memory in Kilobytes used by the VM
|
||||
*/
|
||||
int memory;
|
||||
long int memory;
|
||||
|
||||
/**
|
||||
* CPU usage (percent)
|
||||
|
@ -149,7 +149,7 @@ public:
|
||||
* @param m memory in kb
|
||||
* @param d in mb (system ds usage)
|
||||
*/
|
||||
void add_requirements(float c, int m, long long d);
|
||||
void add_requirements(float c, long int m, long long d);
|
||||
|
||||
/**
|
||||
* Adds (logical AND) new placement requirements to the current ones
|
||||
@ -402,7 +402,7 @@ protected:
|
||||
|
||||
int state;
|
||||
|
||||
int memory;
|
||||
long int memory;
|
||||
float cpu;
|
||||
long long system_ds_usage;
|
||||
|
||||
|
@ -38,7 +38,7 @@ void VirtualMachineXML::init_attributes()
|
||||
|
||||
xpath(state, "/VM/STATE", -1);
|
||||
|
||||
xpath(memory, "/VM/TEMPLATE/MEMORY", 0);
|
||||
xpath<long int>(memory, "/VM/TEMPLATE/MEMORY", 0);
|
||||
xpath<float>(cpu, "/VM/TEMPLATE/CPU", 0);
|
||||
|
||||
// ------------------------ RANK & DS_RANK ---------------------------------
|
||||
@ -204,7 +204,7 @@ ostream& operator<<(ostream& os, VirtualMachineXML& vm)
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
void VirtualMachineXML::add_requirements(float c, int m, long long d)
|
||||
void VirtualMachineXML::add_requirements(float c, long int m, long long d)
|
||||
{
|
||||
cpu += c;
|
||||
memory += m;
|
||||
|
@ -736,8 +736,8 @@ int VirtualMachine::insert(SqlDB * db, string& error_str)
|
||||
string prefix;
|
||||
|
||||
string value;
|
||||
int ivalue;
|
||||
float fvalue;
|
||||
long int ivalue;
|
||||
float fvalue;
|
||||
set<int> cluster_ids;
|
||||
vector<Template *> quotas;
|
||||
|
||||
@ -1752,7 +1752,7 @@ void VirtualMachine::get_requirements (int& cpu, int& memory, int& disk,
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
int VirtualMachine::check_resize (
|
||||
float cpu, int memory, int vcpu, string& error_str)
|
||||
float cpu, long int memory, int vcpu, string& error_str)
|
||||
{
|
||||
if (cpu < 0)
|
||||
{
|
||||
@ -1778,7 +1778,7 @@ int VirtualMachine::check_resize (
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
int VirtualMachine::resize(float cpu, int memory, int vcpu, string& error_str)
|
||||
int VirtualMachine::resize(float cpu, long int memory, int vcpu, string& error_str)
|
||||
{
|
||||
ostringstream oss;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user