File 028-cli-Add-nvram.templateFormat-to-indicate-template-format.patch of Package virt-manager.20250320195526
Subject: cli: Add nvram.templateFormat to indicate template format
From: Lin Ma lma@suse.de Mon Dec 30 19:48:04 2024 +0800
Date: Wed Jan 29 10:48:57 2025 +0100:
Git: dc89a02c75ca7d178c5332fc495a1fceb3732d76
Signed-off-by: Lin Ma <lma@suse.de>
diff --git a/tests/data/cli/compare/virt-install-many-devices.xml b/tests/data/cli/compare/virt-install-many-devices.xml
index e34b487c3..76e044731 100644
--- a/tests/data/cli/compare/virt-install-many-devices.xml
+++ b/tests/data/cli/compare/virt-install-many-devices.xml
@@ -108,6 +108,8 @@
<feature enabled="yes" name="secure-boot"/>
<feature enabled="no" name="enrolled-keys"/>
</firmware>
+ <loader type="pflash">CODE.fd</loader>
+ <nvram template="VARS.fd" templateFormat="raw"/>
<initarg>foo=bar</initarg>
<initarg>baz=woo</initarg>
<initenv name="MYENV">some value</initenv>
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 4e0b2d8c0..8bfccea18 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -500,7 +500,8 @@ bios.useserial=no,bios.rebootTimeout=60,cmdline=root=/foo,\
bootmenu.enable=yes,bootmenu.timeout=5000,\
acpi.table=/path/to/slic.dat,acpi.table.type=slic,\
initenv0.name=MYENV,initenv0='some value',initenv1.name=FOO,initenv1=bar,\
-initdir=/my/custom/cwd,inituser=tester,initgroup=1000
+initdir=/my/custom/cwd,inituser=tester,initgroup=1000,\
+loader_type=pflash,loader=CODE.fd,nvram.template=VARS.fd,nvram.templateFormat=raw
--vcpus vcpus=9,vcpu.placement=static,\
diff --git a/virtinst/cli.py b/virtinst/cli.py
index d8926cdad..6f633b933 100644
--- a/virtinst/cli.py
+++ b/virtinst/cli.py
@@ -2950,6 +2950,7 @@ class ParserBoot(VirtCLIParser):
cls.add_arg("bios.useserial", "bios_useserial", is_onoff=True)
cls.add_arg("bios.rebootTimeout", "bios_rebootTimeout")
cls.add_arg("smbios.mode", "smbios_mode")
+ cls.add_arg("nvram.templateFormat", "nvram_templateFormat")
# Direct kernel boot options
cls.add_arg("kernel", "kernel")
diff --git a/virtinst/domain/os.py b/virtinst/domain/os.py
index 9afcbb910..45d913450 100644
--- a/virtinst/domain/os.py
+++ b/virtinst/domain/os.py
@@ -126,6 +126,7 @@ class DomainOs(XMLBuilder):
bios_useserial = XMLProperty("./bios/@useserial", is_yesno=True)
bios_rebootTimeout = XMLProperty("./bios/@rebootTimeout", is_int=True)
smbios_mode = XMLProperty("./smbios/@mode")
+ nvram_templateFormat = XMLProperty("./nvram/@templateFormat")
# Host bootloader options
# Since the elements for a host bootloader are actually directly under