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/VmInfoBuilderBase.java 1 file changed, 15 insertions(+), 6 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/28/31128/1 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 a311b98..faf3147 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 @@ -69,12 +69,21 @@ 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()))); - if (FeatureSupported.supportedInConfig(ConfigValues.HotPlugCpuSupported, - vm.getVdsGroupCompatibilityVersion(), vm.getClusterArch())) { - createInfo.put(VdsProperties.max_number_of_cpus, - String.valueOf(Config.<Integer> getValue(ConfigValues.MaxNumOfVmCpus, vm.getVdsGroupCompatibilityVersion().getValue()))); + createInfo.put(VdsProperties.cores_per_socket, (Integer.toString(vm.getCpuPerSocket()))); + 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, + maxVCpus.toString()); } } final String compatibilityVersion = vm.getVdsGroupCompatibilityVersion().toString(); -- To view, visit http://gerrit.ovirt.org/31128 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.4 Gerrit-Owner: Roy Golan <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
