Skip to content

Commit a56ebbb

Browse files
committed
Fix UEFI detection on KVM
1 parent a3809bd commit a56ebbb

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,6 +1414,10 @@ private void configureAgentHooks(final Map<String, Object> params) {
14141414
s_logger.debug("agent.hooks.libvirt_vm_on_stop.method is " + _agentHooksVmOnStopMethod);
14151415
}
14161416

1417+
public boolean isUefiPropertiesFileSet() {
1418+
return PropertiesUtil.findConfigFile("uefi.properties") != null;
1419+
}
1420+
14171421
private void loadUefiProperties() throws FileNotFoundException {
14181422

14191423
if (_uefiProperties != null && _uefiProperties.getProperty("guest.loader.legacy") != null) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public final class LibvirtReadyCommandWrapper extends CommandWrapper<ReadyComman
4242
public Answer execute(final ReadyCommand command, final LibvirtComputingResource libvirtComputingResource) {
4343
Map<String, String> hostDetails = new HashMap<String, String>();
4444

45-
if (hostSupportsUefi()) {
45+
if (hostSupportsUefi() && libvirtComputingResource.isUefiPropertiesFileSet()) {
4646
hostDetails.put(Host.HOST_UEFI_ENABLE, Boolean.TRUE.toString());
4747
}
4848

0 commit comments

Comments
 (0)