Roy Golan has uploaded a new change for review.

Change subject: core: Hot plug CPU - allow over-commit in QEMU limits
......................................................................

core: Hot plug CPU - allow over-commit in QEMU limits

Allow to hot plug CPUs up to QEMU limits[1] even if they over-commit the
host resources.

[1] 
http://doc.opensuse.org/products/draft/SLES/SLES-kvm_sd_draft/cha.kvm.limits.html

Change-Id: Ic27aefa52543b201d018d07296de1e4983bfb863
Bug-Url: https://bugzilla.redhat.com/1097175
Signed-off-by: Roy Golan <rgo...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/HotSetNumberOfCpusCommand.java
1 file changed, 13 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/75/31375/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/HotSetNumberOfCpusCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/HotSetNumberOfCpusCommand.java
index d040bc5..1096acb 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/HotSetNumberOfCpusCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/HotSetNumberOfCpusCommand.java
@@ -14,6 +14,8 @@
 import org.ovirt.engine.core.common.action.HotSetNumerOfCpusParameters;
 import org.ovirt.engine.core.common.action.PlugAction;
 import org.ovirt.engine.core.common.businessentities.VMStatus;
+import org.ovirt.engine.core.common.config.Config;
+import org.ovirt.engine.core.common.config.ConfigValues;
 import org.ovirt.engine.core.common.errors.VdcBllMessages;
 import org.ovirt.engine.core.common.errors.VdcFault;
 import org.ovirt.engine.core.common.vdscommands.VDSCommandType;
@@ -53,8 +55,17 @@
             canDo = 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL,
                     LocalizedVmStatus.from(getVm().getStatus()));
         }
-        if (getParameters().getVm().getNumOfCpus() > 
SlaValidator.getEffectiveCpuCores(getVds())) {
-            canDo = 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPUS);
+        if (getParameters().getVm().getCpuPerSocket() >
+                Config.<Integer>getValue(
+                        ConfigValues.MaxNumOfCpuPerSocket,
+                        getVm().getVdsGroupCompatibilityVersion().getValue())) 
{
+            canDo = 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_MAX_CPU_PER_SOCKET);
+        }
+        if (getParameters().getVm().getNumOfSockets() >
+                Config.<Integer>getValue(
+                        ConfigValues.MaxNumOfVmSockets,
+                        getVm().getVdsGroupCompatibilityVersion().getValue())) 
{
+            canDo = 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_MAX_NUM_SOCKETS);
         }
         if (getParameters().getPlugAction() == PlugAction.PLUG) {
             if 
(!FeatureSupported.hotPlugCpu(getVm().getVdsGroupCompatibilityVersion(), 
getVm().getClusterArch())) {


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic27aefa52543b201d018d07296de1e4983bfb863
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Roy Golan <rgo...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to