rohityadavcloud commented on code in PR #7084:
URL: https://github.com/apache/cloudstack/pull/7084#discussion_r1069573955


##########
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:
   I prefer to not have the cmd set to null when we know that's the default 
case.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to