mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-03 15:43:51 +00:00
docs, conf: add support for bootmenu timeout
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
fa82c0f36a
commit
43b8123d39
@ -105,7 +105,7 @@
|
|||||||
<loader>/usr/lib/xen/boot/hvmloader</loader>
|
<loader>/usr/lib/xen/boot/hvmloader</loader>
|
||||||
<boot dev='hd'/>
|
<boot dev='hd'/>
|
||||||
<boot dev='cdrom'/>
|
<boot dev='cdrom'/>
|
||||||
<bootmenu enable='yes'/>
|
<bootmenu enable='yes' timeout='3000'/>
|
||||||
<smbios mode='sysinfo'/>
|
<smbios mode='sysinfo'/>
|
||||||
<bios useserial='yes' rebootTimeout='0'/>
|
<bios useserial='yes' rebootTimeout='0'/>
|
||||||
</os>
|
</os>
|
||||||
@ -158,6 +158,11 @@
|
|||||||
startup. The <code>enable</code> attribute can be either "yes" or "no".
|
startup. The <code>enable</code> attribute can be either "yes" or "no".
|
||||||
If not specified, the hypervisor default is used. <span class="since">
|
If not specified, the hypervisor default is used. <span class="since">
|
||||||
Since 0.8.3</span>
|
Since 0.8.3</span>
|
||||||
|
Additional attribute <code>timeout</code> takes the number of milliseconds
|
||||||
|
the boot menu should wait until it times out. Allowed values are numbers
|
||||||
|
in range [0, 65535] inclusive and it is valid if and only if the previous
|
||||||
|
<code>enable</code> is set to "yes".
|
||||||
|
<span class="since"> Since 1.2.8</span>
|
||||||
</dd>
|
</dd>
|
||||||
<dt><code>smbios</code></dt>
|
<dt><code>smbios</code></dt>
|
||||||
<dd>How to populate SMBIOS information visible in the guest.
|
<dd>How to populate SMBIOS information visible in the guest.
|
||||||
|
@ -259,6 +259,11 @@
|
|||||||
<value>no</value>
|
<value>no</value>
|
||||||
</choice>
|
</choice>
|
||||||
</attribute>
|
</attribute>
|
||||||
|
<optional>
|
||||||
|
<attribute name="timeout">
|
||||||
|
<ref name="unsignedShort"/>
|
||||||
|
</attribute>
|
||||||
|
</optional>
|
||||||
</element>
|
</element>
|
||||||
</optional>
|
</optional>
|
||||||
<optional>
|
<optional>
|
||||||
|
@ -11188,6 +11188,19 @@ virDomainDefParseBootXML(xmlXPathContextPtr ctxt,
|
|||||||
VIR_FREE(tmp);
|
VIR_FREE(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tmp = virXPathString("string(./os/bootmenu[1]/@timeout)", ctxt);
|
||||||
|
if (tmp && def->os.bootmenu == VIR_TRISTATE_BOOL_YES) {
|
||||||
|
if (virStrToLong_uip(tmp, NULL, 0, &def->os.bm_timeout) < 0 ||
|
||||||
|
def->os.bm_timeout > 65535) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
|
||||||
|
_("invalid value for boot menu timeout, "
|
||||||
|
"must be in range [0,65535]"));
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
def->os.bm_timeout_set = true;
|
||||||
|
}
|
||||||
|
VIR_FREE(tmp);
|
||||||
|
|
||||||
tmp = virXPathString("string(./os/bios[1]/@useserial)", ctxt);
|
tmp = virXPathString("string(./os/bios[1]/@useserial)", ctxt);
|
||||||
if (tmp) {
|
if (tmp) {
|
||||||
if (STREQ(tmp, "yes")) {
|
if (STREQ(tmp, "yes")) {
|
||||||
@ -17960,9 +17973,13 @@ virDomainDefFormatInternal(virDomainDefPtr def,
|
|||||||
virBufferAsprintf(buf, "<boot dev='%s'/>\n", boottype);
|
virBufferAsprintf(buf, "<boot dev='%s'/>\n", boottype);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (def->os.bootmenu)
|
if (def->os.bootmenu) {
|
||||||
virBufferAsprintf(buf, "<bootmenu enable='%s'/>\n",
|
virBufferAsprintf(buf, "<bootmenu enable='%s'",
|
||||||
virTristateBoolTypeToString(def->os.bootmenu));
|
virTristateBoolTypeToString(def->os.bootmenu));
|
||||||
|
if (def->os.bm_timeout_set)
|
||||||
|
virBufferAsprintf(buf, " timeout='%u'", def->os.bm_timeout);
|
||||||
|
virBufferAddLit(buf, "/>\n");
|
||||||
|
}
|
||||||
|
|
||||||
if (def->os.bios.useserial || def->os.bios.rt_set) {
|
if (def->os.bios.useserial || def->os.bios.rt_set) {
|
||||||
virBufferAddLit(buf, "<bios");
|
virBufferAddLit(buf, "<bios");
|
||||||
|
@ -1630,6 +1630,8 @@ struct _virDomainOSDef {
|
|||||||
size_t nBootDevs;
|
size_t nBootDevs;
|
||||||
int bootDevs[VIR_DOMAIN_BOOT_LAST];
|
int bootDevs[VIR_DOMAIN_BOOT_LAST];
|
||||||
int bootmenu; /* enum virTristateBool */
|
int bootmenu; /* enum virTristateBool */
|
||||||
|
unsigned int bm_timeout;
|
||||||
|
bool bm_timeout_set;
|
||||||
char *init;
|
char *init;
|
||||||
char **initargv;
|
char **initargv;
|
||||||
char *kernel;
|
char *kernel;
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
<domain type='qemu'>
|
||||||
|
<name>QEMUGuest1</name>
|
||||||
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
|
<memory unit='KiB'>219100</memory>
|
||||||
|
<currentMemory unit='KiB'>219100</currentMemory>
|
||||||
|
<vcpu placement='static'>1</vcpu>
|
||||||
|
<os>
|
||||||
|
<type arch='i686' machine='pc'>hvm</type>
|
||||||
|
<boot dev='cdrom'/>
|
||||||
|
<bootmenu enable='no' timeout='3000'/>
|
||||||
|
</os>
|
||||||
|
<clock offset='utc'/>
|
||||||
|
<on_poweroff>destroy</on_poweroff>
|
||||||
|
<on_reboot>restart</on_reboot>
|
||||||
|
<on_crash>destroy</on_crash>
|
||||||
|
<devices>
|
||||||
|
<emulator>/usr/bin/qemu</emulator>
|
||||||
|
<disk type='block' device='cdrom'>
|
||||||
|
<source dev='/dev/cdrom'/>
|
||||||
|
<target dev='hdc' bus='ide'/>
|
||||||
|
<readonly/>
|
||||||
|
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
|
||||||
|
</disk>
|
||||||
|
<controller type='usb' index='0'/>
|
||||||
|
<controller type='ide' index='0'/>
|
||||||
|
<controller type='pci' index='0' model='pci-root'/>
|
||||||
|
<memballoon model='virtio'/>
|
||||||
|
</devices>
|
||||||
|
</domain>
|
@ -0,0 +1,29 @@
|
|||||||
|
<domain type='qemu'>
|
||||||
|
<name>QEMUGuest1</name>
|
||||||
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
|
<memory unit='KiB'>219100</memory>
|
||||||
|
<currentMemory unit='KiB'>219100</currentMemory>
|
||||||
|
<vcpu placement='static'>1</vcpu>
|
||||||
|
<os>
|
||||||
|
<type arch='i686' machine='pc'>hvm</type>
|
||||||
|
<boot dev='cdrom'/>
|
||||||
|
<bootmenu enable='yes' timeout='65536'/>
|
||||||
|
</os>
|
||||||
|
<clock offset='utc'/>
|
||||||
|
<on_poweroff>destroy</on_poweroff>
|
||||||
|
<on_reboot>restart</on_reboot>
|
||||||
|
<on_crash>destroy</on_crash>
|
||||||
|
<devices>
|
||||||
|
<emulator>/usr/bin/qemu</emulator>
|
||||||
|
<disk type='block' device='cdrom'>
|
||||||
|
<source dev='/dev/cdrom'/>
|
||||||
|
<target dev='hdc' bus='ide'/>
|
||||||
|
<readonly/>
|
||||||
|
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
|
||||||
|
</disk>
|
||||||
|
<controller type='usb' index='0'/>
|
||||||
|
<controller type='ide' index='0'/>
|
||||||
|
<controller type='pci' index='0' model='pci-root'/>
|
||||||
|
<memballoon model='virtio'/>
|
||||||
|
</devices>
|
||||||
|
</domain>
|
@ -0,0 +1,29 @@
|
|||||||
|
<domain type='qemu'>
|
||||||
|
<name>QEMUGuest1</name>
|
||||||
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
|
<memory unit='KiB'>219100</memory>
|
||||||
|
<currentMemory unit='KiB'>219100</currentMemory>
|
||||||
|
<vcpu placement='static'>1</vcpu>
|
||||||
|
<os>
|
||||||
|
<type arch='i686' machine='pc'>hvm</type>
|
||||||
|
<boot dev='cdrom'/>
|
||||||
|
<bootmenu enable='yes' timeout='3000'/>
|
||||||
|
</os>
|
||||||
|
<clock offset='utc'/>
|
||||||
|
<on_poweroff>destroy</on_poweroff>
|
||||||
|
<on_reboot>restart</on_reboot>
|
||||||
|
<on_crash>destroy</on_crash>
|
||||||
|
<devices>
|
||||||
|
<emulator>/usr/bin/qemu</emulator>
|
||||||
|
<disk type='block' device='cdrom'>
|
||||||
|
<source dev='/dev/cdrom'/>
|
||||||
|
<target dev='hdc' bus='ide'/>
|
||||||
|
<readonly/>
|
||||||
|
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
|
||||||
|
</disk>
|
||||||
|
<controller type='usb' index='0'/>
|
||||||
|
<controller type='ide' index='0'/>
|
||||||
|
<controller type='pci' index='0' model='pci-root'/>
|
||||||
|
<memballoon model='virtio'/>
|
||||||
|
</devices>
|
||||||
|
</domain>
|
@ -607,6 +607,7 @@ mymain(void)
|
|||||||
DO_TEST("boot-menu-enable",
|
DO_TEST("boot-menu-enable",
|
||||||
QEMU_CAPS_BOOT_MENU, QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE,
|
QEMU_CAPS_BOOT_MENU, QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE,
|
||||||
QEMU_CAPS_BOOTINDEX);
|
QEMU_CAPS_BOOTINDEX);
|
||||||
|
DO_TEST_PARSE_ERROR("boot-menu-enable-with-timeout-invalid", NONE);
|
||||||
DO_TEST("boot-menu-disable", QEMU_CAPS_BOOT_MENU);
|
DO_TEST("boot-menu-disable", QEMU_CAPS_BOOT_MENU);
|
||||||
DO_TEST("boot-menu-disable-drive",
|
DO_TEST("boot-menu-disable-drive",
|
||||||
QEMU_CAPS_BOOT_MENU, QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE);
|
QEMU_CAPS_BOOT_MENU, QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE);
|
||||||
|
@ -0,0 +1,29 @@
|
|||||||
|
<domain type='qemu'>
|
||||||
|
<name>QEMUGuest1</name>
|
||||||
|
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
|
||||||
|
<memory unit='KiB'>219100</memory>
|
||||||
|
<currentMemory unit='KiB'>219100</currentMemory>
|
||||||
|
<vcpu placement='static'>1</vcpu>
|
||||||
|
<os>
|
||||||
|
<type arch='i686' machine='pc'>hvm</type>
|
||||||
|
<boot dev='cdrom'/>
|
||||||
|
<bootmenu enable='no'/>
|
||||||
|
</os>
|
||||||
|
<clock offset='utc'/>
|
||||||
|
<on_poweroff>destroy</on_poweroff>
|
||||||
|
<on_reboot>restart</on_reboot>
|
||||||
|
<on_crash>destroy</on_crash>
|
||||||
|
<devices>
|
||||||
|
<emulator>/usr/bin/qemu</emulator>
|
||||||
|
<disk type='block' device='cdrom'>
|
||||||
|
<source dev='/dev/cdrom'/>
|
||||||
|
<target dev='hdc' bus='ide'/>
|
||||||
|
<readonly/>
|
||||||
|
<address type='drive' controller='0' bus='1' target='0' unit='0'/>
|
||||||
|
</disk>
|
||||||
|
<controller type='usb' index='0'/>
|
||||||
|
<controller type='ide' index='0'/>
|
||||||
|
<controller type='pci' index='0' model='pci-root'/>
|
||||||
|
<memballoon model='virtio'/>
|
||||||
|
</devices>
|
||||||
|
</domain>
|
@ -171,7 +171,9 @@ mymain(void)
|
|||||||
DO_TEST("boot-network");
|
DO_TEST("boot-network");
|
||||||
DO_TEST("boot-floppy");
|
DO_TEST("boot-floppy");
|
||||||
DO_TEST("boot-multi");
|
DO_TEST("boot-multi");
|
||||||
|
DO_TEST("boot-menu-enable-with-timeout");
|
||||||
DO_TEST("boot-menu-disable");
|
DO_TEST("boot-menu-disable");
|
||||||
|
DO_TEST_DIFFERENT("boot-menu-disable-with-timeout");
|
||||||
DO_TEST("boot-order");
|
DO_TEST("boot-order");
|
||||||
DO_TEST("bootloader");
|
DO_TEST("bootloader");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user