You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/11/26 12:53:55 UTC

[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #4497: kvm: FIX cpucorespersocket is not working on KVM

sureshanaparti commented on a change in pull request #4497:
URL: https://github.com/apache/cloudstack/pull/4497#discussion_r531009458



##########
File path: plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
##########
@@ -4230,4 +4223,26 @@ public boolean isSecureMode(String bootMode) {
 
         return false;
     }
+
+    private void setCpuTopology(CpuModeDef cmd, int vcpus, Map<String, String> details) {
+        // multi cores per socket, for larger core configs
+        int numCoresPerSocket = -1;
+        if (details != null) {
+            final String coresPerSocket = details.get(VmDetailConstants.CPU_CORE_PER_SOCKET);
+            final int intCoresPerSocket = NumbersUtil.parseInt(coresPerSocket, numCoresPerSocket);
+            if (intCoresPerSocket > 0 && vcpus % intCoresPerSocket == 0) {
+                numCoresPerSocket = intCoresPerSocket;
+            }
+        }
+        if (numCoresPerSocket <= 0) {
+            if (vcpus % 6 == 0) {
+                numCoresPerSocket = 6;
+            } else if (vcpus % 4 == 0) {

Review comment:
       when vcpus are 8, it is considered as 4 cores per socket here, instead 8 cores. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org