Skip to content

Commit 6728b69

Browse files
authored
kvm: don't always force scsi controller for aarch64 VMs (#5802)
* kvm: don't force scsi controller for aarch64 VMs This would allow use of virtio disk controller with Ceph, etc or as defined in the VM's root disk controller setting, rather than always enforce SCSI. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com> * remove test that doesn't apply now Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com> * address review comment Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
1 parent 9a5a073 commit 6728b69

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3715,10 +3715,6 @@ public DiskDef.DiskBus getDiskModelFromVMDetail(final VirtualMachineTO vmTO) {
37153715
return null;
37163716
}
37173717

3718-
if (_guestCpuArch != null && _guestCpuArch.equals("aarch64")) {
3719-
return DiskDef.DiskBus.SCSI;
3720-
}
3721-
37223718
String rootDiskController = details.get(VmDetailConstants.ROOT_DISK_CONTROLLER);
37233719
if (StringUtils.isNotBlank(rootDiskController)) {
37243720
s_logger.debug("Passed custom disk controller for ROOT disk " + rootDiskController);
@@ -3752,10 +3748,6 @@ public DiskDef.DiskBus getDataDiskModelFromVMDetail(final VirtualMachineTO vmTO)
37523748
}
37533749

37543750
private DiskDef.DiskBus getGuestDiskModel(final String platformEmulator, boolean isUefiEnabled) {
3755-
if (_guestCpuArch != null && _guestCpuArch.equals("aarch64")) {
3756-
return DiskDef.DiskBus.SCSI;
3757-
}
3758-
37593751
if (platformEmulator == null) {
37603752
return DiskDef.DiskBus.IDE;
37613753
} else if (platformEmulator.startsWith("Other PV Virtio-SCSI")) {
@@ -3766,6 +3758,8 @@ private DiskDef.DiskBus getGuestDiskModel(final String platformEmulator, boolean
37663758
return DiskDef.DiskBus.VIRTIO;
37673759
} else if (isUefiEnabled && org.apache.commons.lang3.StringUtils.startsWithAny(platformEmulator, "Windows", "Other")) {
37683760
return DiskDef.DiskBus.SATA;
3761+
} else if (_guestCpuArch != null && _guestCpuArch.equals("aarch64")) {
3762+
return DiskDef.DiskBus.SCSI;
37693763
} else {
37703764
return DiskDef.DiskBus.IDE;
37713765
}

plugins/hypervisors/kvm/src/test/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ public void testCreateDevicesDef() {
420420
public void testCreateDevicesWithSCSIDisk() {
421421
VirtualMachineTO to = createDefaultVM(false);
422422
to.setDetails(new HashMap<>());
423-
libvirtComputingResourceSpy._guestCpuArch = "aarch64";
423+
to.setPlatformEmulator("Other PV Virtio-SCSI");
424424

425425
GuestDef guest = new GuestDef();
426426
guest.setGuestType(GuestType.KVM);

0 commit comments

Comments
 (0)