From 131d030b4c44906f491ab8f0b890306f670038ea Mon Sep 17 00:00:00 2001 From: Stefan Derkits Date: Thu, 23 May 2013 00:28:06 +0200 Subject: [PATCH] fix bug in Physical machine --- src/at/ac/tuwien/lsdc/management/MachineManager.java | 2 +- src/at/ac/tuwien/lsdc/types/PhysicalMachine.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/at/ac/tuwien/lsdc/management/MachineManager.java b/src/at/ac/tuwien/lsdc/management/MachineManager.java index 1592316..2e304df 100644 --- a/src/at/ac/tuwien/lsdc/management/MachineManager.java +++ b/src/at/ac/tuwien/lsdc/management/MachineManager.java @@ -107,7 +107,7 @@ public class MachineManager { int totalCpu = 0; for (PhysicalMachine pm : PMs.values()) { if (pm.isRunning()) - totalCpu += pm.getCurrentCpu(); + totalCpu += pm.getCurrentCPU(); } return totalCpu; } diff --git a/src/at/ac/tuwien/lsdc/types/PhysicalMachine.java b/src/at/ac/tuwien/lsdc/types/PhysicalMachine.java index b158de9..9e434e9 100644 --- a/src/at/ac/tuwien/lsdc/types/PhysicalMachine.java +++ b/src/at/ac/tuwien/lsdc/types/PhysicalMachine.java @@ -94,15 +94,15 @@ public class PhysicalMachine { } private int availableSize() { - return maxSize - size; + return maxSize - getCurrentSize(); } private int availableRAM() { - return maxRAM - RAM; + return maxRAM - getCurrentRam(); } private int availableCPU() { - return maxCPU - CPU; + return maxCPU - getCurrentCPU(); } public int getCurrentSize() { @@ -119,7 +119,7 @@ public class PhysicalMachine { return currRAM; } - public int getCurrentCpu() { + public int getCurrentCPU() { int currCPU = initialCPU; for (VirtualMachine vm : VMs.values()) currCPU += vm.getCPU(); -- 2.43.0