F #5671: Support for ARM and KVM hypervisor

This commit is contained in:
Ruben S. Montero committed 2021-12-14 13:17:30 +01:00
1 parent b88e478f04
commit 51632f51ce
3 files changed
+16 -24

No files matched your search

+14 -23
View File
@@ -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();
@@ -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";
}
@@ -821,12 +818,6 @@ 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;
@@ -834,13 +825,13 @@ int LibVirtDriver::deployment_description_kvm(
// ------------------------------------------------------------------------
// 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";
}
@@ -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;
}
+1 -1
View File
@@ -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
View File
@@ -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"