mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
qemu: add "-boot strict" to commandline whenever possible
This resolves: https://bugzilla.redhat.com/show_bug.cgi?id=888635 (which was already closed as CANTFIX because the qemu "-boot strict" commandline option wasn't available at the time). Problem: you couldn't have a domain that used PXE to boot, but also had an un-bootable disk device *even if that disk wasn't listed in the boot order*, because if PXE timed out (e.g. due to the bridge forwarding delay), the BIOS would move on to the next target, which would be the unbootable disk device (again - even though it wasn't given a boot order), and get stuck at a "BOOT DISK FAILURE, PRESS ANY KEY" message until a user intervened. The solution available since sometime around QEMU 1.5, is to add "-boot strict=on" to *every* qemu command. When this is done, if any devices have a boot order specified, then QEMU will *only* attempt to boot from those devices that have an explicit boot order, ignoring the rest.
This commit is contained in:
parent
47b9aae0ae
commit
96fddee322
@ -243,6 +243,8 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
|
||||
"virtio-mmio",
|
||||
"ich9-intel-hda",
|
||||
"kvm-pit-lost-tick-policy",
|
||||
|
||||
"boot-strict", /* 160 */
|
||||
);
|
||||
|
||||
struct _virQEMUCaps {
|
||||
@ -2279,6 +2281,7 @@ static struct virQEMUCapsCommandLineProps virQEMUCapsCommandLine[] = {
|
||||
{ "machine", "mem-merge", QEMU_CAPS_MEM_MERGE },
|
||||
{ "drive", "discard", QEMU_CAPS_DRIVE_DISCARD },
|
||||
{ "realtime", "mlock", QEMU_CAPS_MLOCK },
|
||||
{ "boot-opts", "strict", QEMU_CAPS_BOOT_STRICT },
|
||||
};
|
||||
|
||||
static int
|
||||
|
@ -198,6 +198,7 @@ enum virQEMUCapsFlags {
|
||||
QEMU_CAPS_DEVICE_VIRTIO_MMIO = 157, /* -device virtio-mmio */
|
||||
QEMU_CAPS_DEVICE_ICH9_INTEL_HDA = 158, /* -device ich9-intel-hda */
|
||||
QEMU_CAPS_KVM_PIT_TICK_POLICY = 159, /* kvm-pit.lost_tick_policy */
|
||||
QEMU_CAPS_BOOT_STRICT = 160, /* -boot strict */
|
||||
|
||||
QEMU_CAPS_LAST, /* this must always be the last item */
|
||||
};
|
||||
|
@ -8229,6 +8229,12 @@ qemuBuildCommandLine(virConnectPtr conn,
|
||||
def->os.bios.rt_delay);
|
||||
}
|
||||
|
||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BOOT_STRICT)) {
|
||||
if (boot_nparams++)
|
||||
virBufferAddChar(&boot_buf, ',');
|
||||
virBufferAddLit(&boot_buf, "strict=on");
|
||||
}
|
||||
|
||||
if (boot_nparams > 0) {
|
||||
virCommandAddArg(cmd, "-boot");
|
||||
|
||||
|
@ -131,4 +131,5 @@
|
||||
<flag name='usb-storage.removable'/>
|
||||
<flag name='ich9-intel-hda'/>
|
||||
<flag name='kvm-pit-lost-tick-policy'/>
|
||||
<flag name='boot-strict'/>
|
||||
</qemuCaps>
|
||||
|
@ -135,4 +135,5 @@
|
||||
<flag name='virtio-mmio'/>
|
||||
<flag name='ich9-intel-hda'/>
|
||||
<flag name='kvm-pit-lost-tick-policy'/>
|
||||
<flag name='boot-strict'/>
|
||||
</qemuCaps>
|
||||
|
@ -134,4 +134,5 @@
|
||||
<flag name='virtio-mmio'/>
|
||||
<flag name='ich9-intel-hda'/>
|
||||
<flag name='kvm-pit-lost-tick-policy'/>
|
||||
<flag name='boot-strict'/>
|
||||
</qemuCaps>
|
||||
|
@ -600,6 +600,10 @@ mymain(void)
|
||||
QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_BOOT,
|
||||
QEMU_CAPS_BOOTINDEX,
|
||||
QEMU_CAPS_VIRTIO_BLK_SCSI, QEMU_CAPS_VIRTIO_BLK_SG_IO);
|
||||
DO_TEST("boot-strict",
|
||||
QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE, QEMU_CAPS_DRIVE_BOOT,
|
||||
QEMU_CAPS_BOOTINDEX, QEMU_CAPS_BOOT_STRICT,
|
||||
QEMU_CAPS_VIRTIO_BLK_SCSI, QEMU_CAPS_VIRTIO_BLK_SG_IO);
|
||||
DO_TEST("bootloader", QEMU_CAPS_DOMID, QEMU_CAPS_KVM);
|
||||
|
||||
DO_TEST("reboot-timeout-disabled", QEMU_CAPS_REBOOT_TIMEOUT);
|
||||
|
Loading…
Reference in New Issue
Block a user