nvazquez commented on a change in pull request #4172:
URL: https://github.com/apache/cloudstack/pull/4172#discussion_r445223266



##########
File path: 
plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -2098,10 +2101,17 @@ protected StartAnswer execute(StartCommand cmd) {
                     assert (volumeDsDetails != null);
 
                     String[] diskChain = syncDiskChain(dcMo, vmMo, vmSpec, 
vol, matchingExistingDisk, dataStoresDetails);
-                    if (controllerKey == scsiControllerKey && 
VmwareHelper.isReservedScsiDeviceNumber(scsiUnitNumber))
+
+                    int deviceNumber = -1;
+                    if (controllerKey == 
vmMo.getIDEControllerKey(ideUnitNumber)) {
+                        deviceNumber = (ideUnitNumber % 
VmwareHelper.MAX_ALLOWED_DEVICES_IDE_CONTROLLER);

Review comment:
       Also minor: unnecessary parenthesis

##########
File path: 
plugins/hypervisors/vmware/src/main/java/com/cloud/hypervisor/vmware/resource/VmwareResource.java
##########
@@ -2068,13 +2068,16 @@ protected StartAnswer execute(StartCommand cmd) {
                         }
                     }
                 } else {
-                    controllerKey = 
vmMo.getScsiDiskControllerKeyNoException(diskController);
+                    if 
(VmwareHelper.isReservedScsiDeviceNumber(scsiUnitNumber))

Review comment:
       Minor one: can you please add braces to this if statement?

##########
File path: 
vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo/VirtualMachineMO.java
##########
@@ -2412,6 +2419,23 @@ public void ensureScsiDeviceControllers(int count, int 
availableBusNum) throws E
         }
     }
 
+    private boolean isValidScsiDiskController(VirtualSCSIController 
scsiDiskController) {
+        if (scsiDiskController == null) {
+            return false;
+        }
+
+        List<Integer> scsiDiskDevicesOnController = 
scsiDiskController.getDevice();
+        if (scsiDiskDevicesOnController != null && 
scsiDiskDevicesOnController.size() >= 
(VmwareHelper.MAX_SUPPORTED_DEVICES_SCSI_CONTROLLER)) {

Review comment:
       Maybe also a null check for scsiDiskDevicesOnController?




----------------------------------------------------------------
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:
[email protected]


Reply via email to