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


##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtReadyCommandWrapper.java:
##########
@@ -19,18 +19,41 @@
 
 package com.cloud.hypervisor.kvm.resource.wrapper;
 
+import java.util.HashMap;
+import java.util.Map;
+
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.ReadyAnswer;
 import com.cloud.agent.api.ReadyCommand;
+import com.cloud.host.Host;
 import com.cloud.hypervisor.kvm.resource.LibvirtComputingResource;
 import com.cloud.resource.CommandWrapper;
 import com.cloud.resource.ResourceWrapper;
+import com.cloud.utils.script.Script;
+
+import org.apache.log4j.Logger;
 
 @ResourceWrapper(handles =  ReadyCommand.class)
 public final class LibvirtReadyCommandWrapper extends 
CommandWrapper<ReadyCommand, Answer, LibvirtComputingResource> {
 
+    private static final Logger s_logger = 
Logger.getLogger(LibvirtReadyCommandWrapper.class);
+
     @Override
     public Answer execute(final ReadyCommand command, final 
LibvirtComputingResource libvirtComputingResource) {
-        return new ReadyAnswer(command);
+        Map<String, String> hostDetails = new HashMap<String, String>();
+
+        if (hostSupportsUefi()) {
+            hostDetails.put(Host.HOST_UEFI_ENABLE, Boolean.TRUE.toString());
+        }
+
+        return new ReadyAnswer(command, hostDetails);
+    }
+
+    private boolean hostSupportsUefi() {
+        String cmd = "rpm -qa | grep -i ovmf";

Review Comment:
   cc @davidjumani @weizhouapache @DaanHoogland we may need to fix this as we 
support both EL and Ubuntu, rpm isn't installed by default on Ubuntu. Probably 
just check if /sys/firmware/efi using File::exists?



-- 
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