Kobi Ianko has uploaded a new change for review.

Change subject: core: Adding the CpuQos entity
......................................................................

core: Adding the CpuQos entity

Adding a Cpu Qos entity that will be used by the cpu profile.
the cpu profile will be used to set cpu sla parameters of the vm.

Change-Id: I2134a778d70b3c9ff3e78cc38282a515250b7cf2
Bug-Url: https://bugzilla.redhat.com/1084930
Signed-off-by: Kobi Ianko <[email protected]>
---
A 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/qos/CpuQos.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/qos/QosType.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
M 
frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml
4 files changed, 61 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/62/27662/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/qos/CpuQos.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/qos/CpuQos.java
new file mode 100644
index 0000000..980e0c2
--- /dev/null
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/qos/CpuQos.java
@@ -0,0 +1,54 @@
+package org.ovirt.engine.core.common.businessentities.qos;
+
+import java.io.Serializable;
+
+import org.ovirt.engine.core.common.config.ConfigValues;
+import org.ovirt.engine.core.common.utils.ObjectUtils;
+import org.ovirt.engine.core.common.validation.annotation.ConfiguredRange;
+
+public class CpuQos extends BaseQos implements Serializable {
+
+    public CpuQos() {
+        super(QosType.CPU);
+    }
+
+    private static final long serialVersionUID = -7919774054197264133L;
+
+    @ConfiguredRange(min = 1, maxConfigValue = 
ConfigValues.maxCpuLimitQosValue,
+            message = "ACTION_TYPE_FAILED_QOS_OUT_OF_RANGE_VALUES")
+    private Integer cpuLimit;
+
+    @Override
+    public int valuesHashCode() {
+        final int prime = 31;
+        int result = super.hashCode();
+        result = prime * result + ((cpuLimit == null) ? 0 : 
cpuLimit.hashCode());
+        return result;
+    }
+
+    @Override
+    public boolean equalValues(BaseQos obj) {
+        if (this == obj)
+            return true;
+        if (getClass() != obj.getClass())
+            return false;
+        CpuQos other = (CpuQos) obj;
+        if (cpuLimit == null) {
+            if (other.cpuLimit != null)
+                return false;
+        } else if (!cpuLimit.equals(other.cpuLimit))
+            return false;
+        return true;
+    }
+
+    @Override
+    public String getString() {
+        StringBuilder builder = new StringBuilder();
+        builder.append("CpuQos [cpuLimit=");
+        builder.append(cpuLimit);
+        builder.append("]");
+        return builder.toString();
+    }
+
+
+}
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/qos/QosType.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/qos/QosType.java
index 705824b..835c7cf 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/qos/QosType.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/qos/QosType.java
@@ -5,7 +5,8 @@
 import org.ovirt.engine.core.common.businessentities.Identifiable;
 
 public enum QosType implements Identifiable {
-    STORAGE(1);
+    STORAGE(1),
+    CPU(2);
 
     private int value;
     private static final HashMap<Integer, QosType> valueToStatus = new 
HashMap<Integer, QosType>();
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
index edc79ff..53c5120 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
@@ -1716,6 +1716,10 @@
     UserSessionHardLimit,
 
     @TypeConverterAttribute(Integer.class)
+    @DefaultValueAttribute("100")
+    maxCpuLimitQosValue,
+
+    @TypeConverterAttribute(Integer.class)
     @DefaultValueAttribute("1000000")
     maxThroughputUpperBoundQosValue,
 
diff --git 
a/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml
 
b/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml
index 145dd7d..b0cbafb 100644
--- 
a/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml
+++ 
b/frontend/webadmin/modules/gwt-common/src/main/resources/org/ovirt/engine/core/Common.gwt.xml
@@ -197,6 +197,7 @@
                <include name="common/businessentities/qos/BaseQos.java"/>
                <include name="common/businessentities/qos/QosType.java"/>
                <include name="common/businessentities/qos/StorageQos.java"/>
+               <include name="common/businessentities/qos/CpuQos.java"/>
 
                <!-- Misc -->
                <include name="common/AuditLogType.java" />


-- 
To view, visit http://gerrit.ovirt.org/27662
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2134a778d70b3c9ff3e78cc38282a515250b7cf2
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Kobi Ianko <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to