Skip to content
Merged
Show file tree
Hide file tree
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 number Diff line number Diff line change
Expand Up @@ -3713,10 +3713,6 @@ public DiskDef.DiskBus getDiskModelFromVMDetail(final VirtualMachineTO vmTO) {
return null;
}

if (_guestCpuArch != null && _guestCpuArch.equals("aarch64")) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of removing, is it better to move this block to the default else case, because the default case always returns IDE ? I'm thinking in terms of backward compatibility

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This my own hardcoded check for experimental arm64 guest CPU/platform, this is only hit for users using arm64 hosts such as Ampere or Raspberry Pi4 - so there's no backward compatibility to take into consideration.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... on second thought, I've moved the code to fallback as default for aarch64 when other controller's can't be found/guessed.

return DiskDef.DiskBus.SCSI;
}

String rootDiskController = details.get(VmDetailConstants.ROOT_DISK_CONTROLLER);
if (StringUtils.isNotBlank(rootDiskController)) {
s_logger.debug("Passed custom disk controller for ROOT disk " + rootDiskController);
Expand Down Expand Up @@ -3750,10 +3746,6 @@ public DiskDef.DiskBus getDataDiskModelFromVMDetail(final VirtualMachineTO vmTO)
}

private DiskDef.DiskBus getGuestDiskModel(final String platformEmulator, boolean isUefiEnabled) {
if (_guestCpuArch != null && _guestCpuArch.equals("aarch64")) {
return DiskDef.DiskBus.SCSI;
}

if (platformEmulator == null) {
return DiskDef.DiskBus.IDE;
} else if (platformEmulator.startsWith("Other PV Virtio-SCSI")) {
Expand All @@ -3764,6 +3756,8 @@ private DiskDef.DiskBus getGuestDiskModel(final String platformEmulator, boolean
return DiskDef.DiskBus.VIRTIO;
} else if (isUefiEnabled && org.apache.commons.lang3.StringUtils.startsWithAny(platformEmulator, "Windows", "Other")) {
return DiskDef.DiskBus.SATA;
} else if (_guestCpuArch != null && _guestCpuArch.equals("aarch64")) {
return DiskDef.DiskBus.SCSI;
} else {
return DiskDef.DiskBus.IDE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ public void testCreateDevicesDef() {
public void testCreateDevicesWithSCSIDisk() {
VirtualMachineTO to = createDefaultVM(false);
to.setDetails(new HashMap<>());
libvirtComputingResourceSpy._guestCpuArch = "aarch64";
to.setPlatformEmulator("Other PV Virtio-SCSI");

GuestDef guest = new GuestDef();
guest.setGuestType(GuestType.KVM);
Expand Down