Roy Golan has uploaded a new change for review.

Change subject: core: calculating the maxVcpus in the limits of qemu
......................................................................

core: calculating the maxVcpus in the limits of qemu

calulate the right maxVCpus we send to VDSM to be in the limits of qemu
max number of sockets.

this eliminates the need to send an extra argument to VDSM
maxNumberOfSockets and eliminates an API change.

Change-Id: I452d0614406ed5e9e20ac3212a5d07e7a4e4b269
Bug-Url: https://bugzilla.redhat.com/1070890
Signed-off-by: Roy Golan <[email protected]>
---
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilderBase.java
2 files changed, 8 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/27/31127/1

diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java
index f2334cf..5df1593 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VdsProperties.java
@@ -220,7 +220,6 @@
     public static final String num_of_cpus = "smp";
     public static final String cores_per_socket = "smpCoresPerSocket";
     public static final String max_number_of_cpus = "maxVCpus";
-    public static final String max_number_of_sockets = "maxNumberOfSockets";
     public static final String cpuPinning = "cpuPinning";
     public static final String vm_name = "vmName";
     public static final String vm_guid = "vmId";
diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilderBase.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilderBase.java
index e423ef0..c1763d2 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilderBase.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/vdsbroker/VmInfoBuilderBase.java
@@ -79,20 +79,20 @@
         createInfo.put(VdsProperties.num_of_cpus, 
String.valueOf(vm.getNumOfCpus()));
         if (Config.<Boolean> getValue(ConfigValues.SendSMPOnRunVm)) {
             createInfo.put(VdsProperties.cores_per_socket, 
(Integer.toString(vm.getCpuPerSocket())));
-            createInfo.put(
-                    VdsProperties.max_number_of_sockets,
-                    Config.<Integer> getValue(
-                            ConfigValues.MaxNumOfVmSockets,
-                            
vm.getVdsGroupCompatibilityVersion().getValue()).toString());
             if (FeatureSupported.supportedInConfig(
                     ConfigValues.HotPlugCpuSupported,
                     vm.getVdsGroupCompatibilityVersion(),
                     vm.getClusterArch())) {
+                Integer maxSockets = Config.<Integer>getValue(
+                        ConfigValues.MaxNumOfVmSockets,
+                        vm.getVdsGroupCompatibilityVersion().getValue());
+                Integer maxVCpus = Config.<Integer>getValue(
+                        ConfigValues.MaxNumOfVmCpus,
+                        vm.getVdsGroupCompatibilityVersion().getValue());
+                maxVCpus = Math.min(maxVCpus, (vm.getCpuPerSocket() * 
maxSockets));
                 createInfo.put(
                         VdsProperties.max_number_of_cpus,
-                        Config.<Integer> getValue(
-                                ConfigValues.MaxNumOfVmCpus,
-                                
vm.getVdsGroupCompatibilityVersion().getValue()).toString());
+                        maxVCpus.toString());
             }
         }
         final String compatibilityVersion = 
vm.getVdsGroupCompatibilityVersion().toString();


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

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

Reply via email to