From 3a8c7b8cd746cbb737afcdfba1ad0262f9a5abe3 Mon Sep 17 00:00:00 2001 From: Alberto Faria Date: Wed, 24 Apr 2024 21:49:02 +0100 Subject: [PATCH] create: Use UEFI This is required when enabling ACPI on aarch64, and probably a good idea in general. Signed-off-by: Alberto Faria --- src/commands/create/domain.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/commands/create/domain.rs b/src/commands/create/domain.rs index c16ad8f..6e81263 100644 --- a/src/commands/create/domain.rs +++ b/src/commands/create/domain.rs @@ -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