DaanHoogland commented on a change in pull request #3638: UEFI Support on
CloudStack
URL: https://github.com/apache/cloudstack/pull/3638#discussion_r391680560
##########
File path:
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
##########
@@ -2079,6 +2109,18 @@ public LibvirtVMDef createVMFromSpec(final
VirtualMachineTO vmTO) {
vm.setDomDescription(vmTO.getOs());
vm.setPlatformEmulator(vmTO.getPlatformEmulator());
+ Map<String, String> customParams = vmTO.getDetails();
+ boolean isUefiEnabled = false;
+ boolean isSecureBoot = false;
+ String bootMode =null;
+ if (MapUtils.isNotEmpty(customParams) &&
customParams.containsKey(GuestDef.BootType.UEFI.toString())) {
+ isUefiEnabled = true;
+ bootMode = customParams.get(GuestDef.BootType.UEFI.toString());
+ if (StringUtils.isNotBlank(bootMode) &&
"secure".equalsIgnoreCase(bootMode)) {
+ isSecureBoot = true;
+ }
+ }
+
Review comment:
this method is 300+ lines and should be partitioned to be readable. Please,
extract at least any new code to methods of around 10 (max 20) lines with
limited complexity, i.e. not triple nested blocks/only responsibility per
method.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services