[VMware] Consider CD/DVD drive when calculating next free unit number for volume attachment over IDE controller (#9644)

Co-authored-by: dahn <daan.hoogland@gmail.com>
This commit is contained in:
Fabricio Duarte 2025-01-15 12:00:46 -03:00 committed by GitHub
parent cf5bd80311
commit e278bcd08a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3169,9 +3169,12 @@ public class VirtualMachineMO extends BaseMO {
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();
}