cli: --boot: Completed options for direct kernel boot

Adds support for `acpi.table` and `acpi.table.type` suboptions.
This commit is contained in:
Hugues Fafard
2021-07-28 15:11:17 +02:00
committed by Cole Robinson
parent 0a856179a5
commit 7bc4ba81ff
4 changed files with 46 additions and 6 deletions

View File

@@ -0,0 +1,34 @@
<domain type="test">
<name>vm1</name>
<uuid>00000000-1111-2222-3333-444444444444</uuid>
<memory>65536</memory>
<currentMemory>65536</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch="i686">hvm</type>
<kernel>/path/to/kernel</kernel>
<initrd>/path/to/initrd</initrd>
<cmdline>console=ttyS0</cmdline>
<dtb>/path/to/dtb</dtb>
<acpi>
<table type="slic">/path/to/slic.dat</table>
</acpi>
</os>
<features>
<pae/>
</features>
<clock offset="utc"/>
<pm>
<suspend-to-mem enabled="no"/>
<suspend-to-disk enabled="no"/>
</pm>
<devices>
<emulator>/usr/bin/test-hv</emulator>
<controller type="usb" model="none"/>
<interface type="user">
<mac address="00:11:22:33:44:55"/>
<model type="e1000"/>
</interface>
<console type="pty"/>
</devices>
</domain>

View File

@@ -759,6 +759,7 @@ c.add_compare("--boot loader=/path/to/loader,loader_secure=yes", "boot-loader-se
c.add_compare("--boot firmware=bios,loader=/path/to/loader,loader.readonly=yes,loader.secure=no,loader.type=rom,bios.rebootTimeout=5000,bootmenu.enable=yes,bootmenu.timeout=5000", "boot-guest-loader-bios")
c.add_compare("--boot firmware=efi,loader=/path/to/loader,loader.readonly=yes,loader.secure=yes,loader.type=pflash,bios.useserial=yes,nvram=/path/to/nvram", "boot-guest-loader-efi")
c.add_compare("--boot bootloader=/usr/bin/pygrub,bootloader_args='--append single'", "boot-host-loader")
c.add_compare("--boot kernel=/path/to/kernel,initrd=/path/to/initrd,cmdline='console=ttyS0',dtb=/path/to/dtb,acpi.table=/path/to/slic.dat,acpi.table.type=slic", "boot-direct-kernel")

View File

@@ -2669,8 +2669,10 @@ class ParserBoot(VirtCLIParser):
cls.add_arg("kernel", "kernel")
cls.add_arg("initrd", "initrd")
cls.add_arg("dtb", "dtb")
cls.add_arg("cmdline", "kernel_args", can_comma=True)
cls.add_arg("dtb", "dtb")
cls.add_arg("acpi.table", "acpi_tb")
cls.add_arg("acpi.table.type", "acpi_tb_type")
cls.add_arg("firmware", "firmware")
cls.add_arg("firmware.feature[0-9]*.enabled", "enabled",

View File

@@ -101,6 +101,14 @@ class DomainOs(XMLBuilder):
# <domain> rather than <domain><os>, they are handled via callbacks in
# the CLI. This is just a placeholder to remind of that fact.
# Direct kernel boot
kernel = XMLProperty("./kernel", do_abspath=True)
initrd = XMLProperty("./initrd", do_abspath=True)
kernel_args = XMLProperty("./cmdline")
dtb = XMLProperty("./dtb", do_abspath=True)
acpi_tb = XMLProperty("./acpi/table", do_abspath=True)
acpi_tb_type = XMLProperty("./acpi/table/@type")
initargs = XMLChildProperty(_InitArg)
def set_initargs_string(self, argstring):
import shlex
@@ -110,11 +118,6 @@ class DomainOs(XMLBuilder):
obj = self.initargs.add_new()
obj.val = val
kernel = XMLProperty("./kernel", do_abspath=True)
initrd = XMLProperty("./initrd", do_abspath=True)
dtb = XMLProperty("./dtb", do_abspath=True)
kernel_args = XMLProperty("./cmdline")
init = XMLProperty("./init")
initdir = XMLProperty("./initdir")
inituser = XMLProperty("./inituser")