Skip to content

Commit

Permalink
F #5671: Support for ARM and KVM hypervisor
Browse files Browse the repository at this point in the history
  • Loading branch information
rsmontero committed Dec 14, 2021
1 parent b88e478 commit 51632f5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 24 deletions.
37 changes: 14 additions & 23 deletions src/vmm/LibVirtDriverKVM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -628,10 +628,6 @@ int LibVirtDriver::deployment_description_kvm(
std::string sd_bus;
std::string disk_bus;

bool pm_defaults = true;
std::string pm_suspend_to_disk = "yes";
std::string pm_suspend_to_mem = "yes";

string vm_xml;

Nebula& nd = Nebula::instance();
Expand Down Expand Up @@ -799,17 +795,18 @@ int LibVirtDriver::deployment_description_kvm(
}

bool boot_secure = false;

string firmware;

get_attribute(vm, nullptr, nullptr, "OS", "FIRMWARE", firmware);

if ( !firmware.empty() && !one_util::icasecmp(firmware, "BIOS") )

bool is_uefi = !firmware.empty() && !one_util::icasecmp(firmware, "BIOS");

if ( is_uefi )
{
string firmware_secure = "no";
if ( get_attribute(vm, nullptr, nullptr, "OS", "FIRMWARE_SECURE", boot_secure) &&
boot_secure)

if ( get_attribute(vm, nullptr, nullptr, "OS", "FIRMWARE_SECURE",
boot_secure) && boot_secure)
{
firmware_secure = "yes";
}
Expand All @@ -821,26 +818,20 @@ int LibVirtDriver::deployment_description_kvm(
file << "\t\t<nvram>"
<< vm->get_system_dir() << "/" << vm->get_name() << "_VARS.fd"
<< "</nvram>\n";

// Suspend to mem and disk disabled to avoid boot problems with UEFI
// firmware
pm_defaults = false;
pm_suspend_to_disk = "no";
pm_suspend_to_mem = "no";
}

file << "\t</os>" << endl;

// ------------------------------------------------------------------------
// POWER MANAGEMENT SECTION
// ------------------------------------------------------------------------
if (!pm_defaults)
if ( is_uefi && arch != "aarch64" )
{
// Suspend to mem and disk disabled to avoid boot problems with UEFI
// firmware in x86 arch
file << "\t<pm>\n"
<< "\t\t<suspend-to-disk enabled=\"" << pm_suspend_to_disk
<< "\"/>\n"
<< "\t\t<suspend-to-mem enabled=\"" << pm_suspend_to_mem
<< "\"/>\n"
<< "\t\t<suspend-to-disk enabled=\"no\"/>\n"
<< "\t\t<suspend-to-mem enabled=\"no\"/>\n"
<< "\t</pm>\n";
}

Expand Down Expand Up @@ -1852,7 +1843,7 @@ int LibVirtDriver::deployment_description_kvm(
file << "\t\t<pae/>" << endl;
}

if ( acpi )
if ( acpi && (arch != "aarch64" || is_uefi ))
{
file << "\t\t<acpi/>" << endl;
}
Expand Down
2 changes: 1 addition & 1 deletion src/vmm_mad/exec/vmm_exec_kvm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ SPICE_OPTIONS = "
#
# Open Virtual Machine Firware (UEFI Firmware)
# List of valid firmware available to users (full path in the hosts)
OVMF_UEFIS = "/usr/share/OVMF/OVMF_CODE.fd /usr/share/OVMF/OVMF_CODE.secboot.fd"
OVMF_UEFIS = "/usr/share/OVMF/OVMF_CODE.fd /usr/share/OVMF/OVMF_CODE.secboot.fd /usr/share/AAVMF/AAVMF_CODE.fd"
1 change: 1 addition & 0 deletions src/vmm_mad/remotes/kvm/kvmrc
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,5 @@ DEFAULT_ATTACH_NIC_MODEL=virtio
#DEFAULT_ATTACH_NIC_FILTER=clean-traffic

# Virtual Machine Firmware path to the NVRAM file
# OVMF_NVRAM="/usr/share/AAVMF/AAVMF_VARS.fd" for aarch64 guests
OVMF_NVRAM="/usr/share/OVMF/OVMF_VARS.fd"

0 comments on commit 51632f5

Please sign in to comment.