File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
vmware-base/src/main/java/com/cloud/hypervisor/vmware/mo Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -3169,9 +3169,12 @@ public int getFreeUnitNumberOnIDEController(int controllerKey) throws Exception
31693169
31703170 int deviceCount = 0 ;
31713171 int ideDeviceUnitNumber = -1 ;
3172- if (devices != null && devices . size () > 0 ) {
3172+ if (devices != null ) {
31733173 for (VirtualDevice device : devices ) {
3174- if (device instanceof VirtualDisk && (controllerKey == device .getControllerKey ())) {
3174+ if (device .getControllerKey () == null || device .getControllerKey () != controllerKey ) {
3175+ continue ;
3176+ }
3177+ if (device instanceof VirtualDisk || device instanceof VirtualCdrom ) {
31753178 deviceCount ++;
31763179 ideDeviceUnitNumber = device .getUnitNumber ();
31773180 }
You can’t perform that action at this time.
0 commit comments