Skip to content

Commit

Permalink
create: Use UEFI
Browse files Browse the repository at this point in the history
This is required when enabling ACPI on aarch64, and probably a good idea
in general.

Signed-off-by: Alberto Faria <[email protected]>
  • Loading branch information
albertofaria committed Apr 25, 2024
1 parent 102a425 commit 3a8c7b8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/commands/create/domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,18 @@ fn generate(
let memory = get_memory_size(spec).to_string();
st(w, "memory", &[("unit", "b")], memory.as_str())?;

s(w, "os", &[], |w| {
s(w, "os", &[("firmware", "efi")], |w| {
let attrs = match ["x86", "x86_64"].contains(&env::consts::ARCH) {
true => [("machine", "q35")].as_slice(),
false => [].as_slice(), // use libvirt's default
};
st(w, "type", attrs, "hvm")
st(w, "type", attrs, "hvm")?;

s(w, "firmware", &[], |w| {
se(w, "feature", &[("enabled", "no"), ("name", "secure-boot")])
})?;

Ok(())
})?;

// fw_cfg requires ACPI
Expand Down

0 comments on commit 3a8c7b8

Please sign in to comment.