Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line numberDiff line numberDiff line change
Expand Up@@ -3169,9 +3169,12 @@ public int getFreeUnitNumberOnIDEController(int controllerKey) throws Exception

int deviceCount = 0;
int ideDeviceUnitNumber = -1;
if (devices != null && devices.size() > 0) {
if (devices != null) {
for (VirtualDevice device : devices) {
if (device instanceof VirtualDisk && (controllerKey == device.getControllerKey())) {
if (device.getControllerKey() == null || device.getControllerKey() != controllerKey) {
continue;
}
if (device instanceof VirtualDisk || device instanceof VirtualCdrom) {
deviceCount++;
ideDeviceUnitNumber = device.getUnitNumber();
}
Expand Down