cli: --boot: Completed options for guest-based bootloader
Adds support for `bootmenu.timeout` suboption.
This commit is contained in:
parent
f067435e2a
commit
a24cdd1964
|
@ -0,0 +1,31 @@
|
|||
<domain type="test">
|
||||
<name>vm1</name>
|
||||
<uuid>00000000-1111-2222-3333-444444444444</uuid>
|
||||
<memory>65536</memory>
|
||||
<currentMemory>65536</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os firmware="bios">
|
||||
<type arch="i686">hvm</type>
|
||||
<loader readonly="yes" type="rom" secure="no">/path/to/loader</loader>
|
||||
<boot dev="hd"/>
|
||||
<bootmenu enable="yes" timeout="5000"/>
|
||||
<bios rebootTimeout="5000"/>
|
||||
</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>
|
|
@ -0,0 +1,31 @@
|
|||
<domain type="test">
|
||||
<name>vm1</name>
|
||||
<uuid>00000000-1111-2222-3333-444444444444</uuid>
|
||||
<memory>65536</memory>
|
||||
<currentMemory>65536</currentMemory>
|
||||
<vcpu>1</vcpu>
|
||||
<os firmware="efi">
|
||||
<type arch="i686">hvm</type>
|
||||
<loader readonly="yes" type="pflash" secure="yes">/path/to/loader</loader>
|
||||
<nvram>/path/to/nvram</nvram>
|
||||
<boot dev="hd"/>
|
||||
<bios useserial="yes"/>
|
||||
</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>
|
|
@ -47,7 +47,7 @@
|
|||
<cmdline>root=/foo</cmdline>
|
||||
<boot dev="hd"/>
|
||||
<smbios mode="sysinfo"/>
|
||||
<bootmenu enable="yes"/>
|
||||
<bootmenu enable="yes" timeout="5000"/>
|
||||
<bios useserial="no" rebootTimeout="60"/>
|
||||
</os>
|
||||
<features>
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
<loader>/foo/loader</loader>
|
||||
<boot dev="fd"/>
|
||||
<init>/sbin/init</init>
|
||||
<bootmenu enable="no"/>
|
||||
<bios useserial="yes"/>
|
||||
<bootmenu enable="no" timeout="30000"/>
|
||||
<bios useserial="yes" rebootTimeout="-1"/>
|
||||
<initarg>foo</initarg>
|
||||
<initarg>bar baz</initarg>
|
||||
<initarg>frib</initarg>
|
||||
|
|
|
@ -563,7 +563,7 @@ c.add_compare("""
|
|||
--disk none
|
||||
--features apic.eoi=off,hap=on,hyperv.synic.state=on,hyperv.reset.state=off,hyperv.spinlocks.state=on,hyperv.spinlocks.retries=5678,pae=on,pmu.state=on,pvspinlock.state=off,smm.state=off,viridian=on,vmcoreinfo.state=on,vmport.state=off,kvm.hidden.state=on,hyperv.vapic.state=off,hyperv.relaxed.state=off,gic.version=host,kvm.hint-dedicated.state=on,kvm.poll-control.state=on
|
||||
--clock rtc_present=no,pit_present=yes,pit_tickpolicy=catchup,tsc_present=no,platform_present=no,hypervclock_present=no,platform_tickpolicy=foo,hpet_tickpolicy=bar,tsc_tickpolicy=wibble,kvmclock_tickpolicy=wobble,hypervclock_tickpolicy=woo
|
||||
--boot bios.useserial=no,bios.rebootTimeout=60,cmdline=root=/foo,smbios.mode=host,bootmenu.enable=yes,loader_ro=yes,loader.type=rom,loader=/tmp/foo
|
||||
--boot bios.useserial=no,bios.rebootTimeout=60,cmdline=root=/foo,smbios.mode=host,bootmenu.enable=yes,bootmenu.timeout=5000,loader_ro=yes,loader.type=rom,loader=/tmp/foo
|
||||
--memorybacking access.mode=shared,source.type=anonymous,hugepages=on
|
||||
--graphics spice,gl=yes
|
||||
--rng type=egd,backend.type=nmdm,backend.source.master=/dev/foo1,backend.source.slave=/dev/foo2
|
||||
|
@ -756,6 +756,8 @@ source.reservations.managed=no,source.reservations.source.type=unix,source.reser
|
|||
|
||||
c = vinst.add_category("boot", "--nographics --noautoconsole --import --disk none --controller usb,model=none")
|
||||
c.add_compare("--boot loader=/path/to/loader,loader_secure=yes", "boot-loader-secure")
|
||||
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")
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -134,8 +134,10 @@ def testAlterGuest():
|
|||
check("loader", None, "/foo/loader")
|
||||
check("init", None, "/sbin/init")
|
||||
check("bootorder", ["hd"], ["fd"])
|
||||
check("enable_bootmenu", None, False)
|
||||
check("useserial", None, True)
|
||||
check("bootmenu_enable", None, False)
|
||||
check("bootmenu_timeout", None, 30000)
|
||||
check("bios_useserial", None, True)
|
||||
check("bios_rebootTimeout", None, -1)
|
||||
check("kernel", None)
|
||||
check("initrd", None)
|
||||
check("kernel_args", None)
|
||||
|
|
|
@ -703,7 +703,7 @@ class vmmDomain(vmmLibvirtObject):
|
|||
guest.set_boot_order(boot_order, legacy=legacy)
|
||||
|
||||
if boot_menu != _SENTINEL:
|
||||
guest.os.enable_bootmenu = bool(boot_menu)
|
||||
guest.os.bootmenu_enable = bool(boot_menu)
|
||||
if init != _SENTINEL:
|
||||
guest.os.init = init
|
||||
guest.os.set_initargs_string(initargs)
|
||||
|
@ -1259,7 +1259,7 @@ class vmmDomain(vmmLibvirtObject):
|
|||
|
||||
def get_boot_menu(self):
|
||||
guest = self.get_xmlobj()
|
||||
return bool(guest.os.enable_bootmenu)
|
||||
return bool(guest.os.bootmenu_enable)
|
||||
def get_boot_kernel_info(self):
|
||||
guest = self.get_xmlobj()
|
||||
return (guest.os.kernel, guest.os.initrd,
|
||||
|
|
|
@ -2674,9 +2674,10 @@ class ParserBoot(VirtCLIParser):
|
|||
find_inst_cb=cls.feature_find_inst_cb)
|
||||
cls.add_arg("boot[0-9]*.dev", "dev",
|
||||
find_inst_cb=cls.boot_find_inst_cb)
|
||||
cls.add_arg("bootmenu.enable", "enable_bootmenu", is_onoff=True)
|
||||
cls.add_arg("bios.useserial", "useserial", is_onoff=True)
|
||||
cls.add_arg("bios.rebootTimeout", "rebootTimeout")
|
||||
cls.add_arg("bootmenu.enable", "bootmenu_enable", is_onoff=True)
|
||||
cls.add_arg("bootmenu.timeout", "bootmenu_timeout")
|
||||
cls.add_arg("bios.useserial", "bios_useserial", is_onoff=True)
|
||||
cls.add_arg("bios.rebootTimeout", "bios_rebootTimeout")
|
||||
cls.add_arg("init", "init")
|
||||
cls.add_arg("initargs", "initargs", cb=cls.set_initargs_cb)
|
||||
cls.add_arg("initarg[0-9]*", "val",
|
||||
|
|
|
@ -78,6 +78,7 @@ class DomainOs(XMLBuilder):
|
|||
"initdir", "inituser", "initgroup",
|
||||
"kernel_args", "dtb", "bootdevs", "smbios_mode"]
|
||||
|
||||
# BIOS bootloader
|
||||
def _get_bootorder(self):
|
||||
return [dev.dev for dev in self.bootdevs]
|
||||
def _set_bootorder(self, newdevs):
|
||||
|
@ -87,8 +88,13 @@ class DomainOs(XMLBuilder):
|
|||
for d in newdevs:
|
||||
dev = self.bootdevs.add_new()
|
||||
dev.dev = d
|
||||
bootdevs = XMLChildProperty(_BootDevice)
|
||||
bootorder = property(_get_bootorder, _set_bootorder)
|
||||
bootdevs = XMLChildProperty(_BootDevice)
|
||||
smbios_mode = XMLProperty("./smbios/@mode")
|
||||
bootmenu_enable = XMLProperty("./bootmenu/@enable", is_yesno=True)
|
||||
bootmenu_timeout = XMLProperty("./bootmenu/@timeout", is_int=True)
|
||||
bios_rebootTimeout = XMLProperty("./bios/@rebootTimeout", is_int=True)
|
||||
bios_useserial = XMLProperty("./bios/@useserial", is_yesno=True)
|
||||
|
||||
initargs = XMLChildProperty(_InitArg)
|
||||
def set_initargs_string(self, argstring):
|
||||
|
@ -99,10 +105,6 @@ class DomainOs(XMLBuilder):
|
|||
obj = self.initargs.add_new()
|
||||
obj.val = val
|
||||
|
||||
enable_bootmenu = XMLProperty("./bootmenu/@enable", is_yesno=True)
|
||||
rebootTimeout = XMLProperty("./bios/@rebootTimeout")
|
||||
useserial = XMLProperty("./bios/@useserial", is_yesno=True)
|
||||
|
||||
kernel = XMLProperty("./kernel", do_abspath=True)
|
||||
initrd = XMLProperty("./initrd", do_abspath=True)
|
||||
dtb = XMLProperty("./dtb", do_abspath=True)
|
||||
|
@ -116,7 +118,6 @@ class DomainOs(XMLBuilder):
|
|||
loader_ro = XMLProperty("./loader/@readonly", is_yesno=True)
|
||||
loader_type = XMLProperty("./loader/@type")
|
||||
loader_secure = XMLProperty("./loader/@secure", is_yesno=True)
|
||||
smbios_mode = XMLProperty("./smbios/@mode")
|
||||
nvram = XMLProperty("./nvram", do_abspath=True)
|
||||
nvram_template = XMLProperty("./nvram/@template")
|
||||
arch = XMLProperty("./type/@arch")
|
||||
|
|
Loading…
Reference in New Issue