You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2023/01/12 12:57:30 UTC
[GitHub] [cloudstack] DaanHoogland commented on a diff in pull request #7084: kvm: make UEFI host check to support both Ubuntu and EL
DaanHoogland commented on code in PR #7084:
URL: https://github.com/apache/cloudstack/pull/7084#discussion_r1068090896
##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtReadyCommandWrapper.java:
##########
@@ -42,18 +42,21 @@ public final class LibvirtReadyCommandWrapper extends CommandWrapper<ReadyComman
public Answer execute(final ReadyCommand command, final LibvirtComputingResource libvirtComputingResource) {
Map<String, String> hostDetails = new HashMap<String, String>();
- if (hostSupportsUefi() && libvirtComputingResource.isUefiPropertiesFileLoaded()) {
+ if (hostSupportsUefi(libvirtComputingResource.isUbuntuHost()) && libvirtComputingResource.isUefiPropertiesFileLoaded()) {
hostDetails.put(Host.HOST_UEFI_ENABLE, Boolean.TRUE.toString());
}
return new ReadyAnswer(command, hostDetails);
}
- private boolean hostSupportsUefi() {
+ private boolean hostSupportsUefi(boolean isUbuntuHost) {
String cmd = "rpm -qa | grep -i ovmf";
+ if (isUbuntuHost) {
+ cmd = "dpkg -l ovmf";
+ }
Review Comment:
```suggestion
String cmd = null;
if (isUbuntuHost) {
cmd = "dpkg -l ovmf";
} else {
cmd = "rpm -qa | grep -i ovmf";
}
```
--
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.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org