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 2021/05/13 15:08:36 UTC

[GitHub] [cloudstack] GabrielBrascher commented on a change in pull request #4662: Feat/ram reservation

GabrielBrascher commented on a change in pull request #4662:
URL: https://github.com/apache/cloudstack/pull/4662#discussion_r631882117



##########
File path: plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/guru/VmwareVmImplementer.java
##########
@@ -139,6 +140,9 @@ VirtualMachineTO implement(VirtualMachineProfile vm, VirtualMachineTO to, long c
                     details.put(VmDetailConstants.NIC_ADAPTER, VirtualEthernetCardType.E1000.toString());
                 }
             }
+            if(StringUtils.isEmpty(details.get(VmDetailConstants.RAM_RESERVATION))){
+                details.put(VmDetailConstants.RAM_RESERVATION, "0.0");

Review comment:
       There are two occurrences of the "0.0" String.
   
   What do you think of replacing these `"0.0"` with `NumberUtils.DOUBLE_ZERO`? The NumberUtils will return a `Double` object of `0.0d` and, therefore, it has a `toString()` that returns the String `"0.0"`.
   
   Other option would be to create a constant with a self-describing name.

##########
File path: vmware-base/src/main/java/com/cloud/hypervisor/vmware/util/VmwareHelper.java
##########
@@ -549,12 +549,6 @@ public static void setBasicVmConfig(VirtualMachineConfigSpec vmConfig, int cpuCo
 
         cpuInfo.setReservation((long)cpuReservedMhz);
         vmConfig.setCpuAllocation(cpuInfo);
-        if (cpuSpeedMHz != cpuReservedMhz) {
-            vmConfig.setCpuHotAddEnabled(true);
-        }
-        if (memoryMB != memoryReserveMB) {
-            vmConfig.setMemoryHotAddEnabled(true);
-        }

Review comment:
       I have not much experience with the codebase for VMware to comment on this piece of code. Good that it has been verified. I will rely on the contributor tests.




-- 
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