This is a cut-down version of the SeaBIOS configuration optimized for booting a Linux kernel with the -kernel option on x86. It was added in qemu 2.7. Use it if available. --- src/launch-direct.c | 6 ++++++ src/launch-libvirt.c | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/src/launch-direct.c b/src/launch-direct.c index 20f6471..332118e 100644 --- a/src/launch-direct.c +++ b/src/launch-direct.c @@ -436,6 +436,12 @@ launch_direct (guestfs_h *g, void *datav, const char *arg) ADD_CMDLINE ("-initrd"); ADD_CMDLINE (initrd); + if (guestfs_int_qemu_supports_bios (g, data->qemu_data, "bios-fast.bin")) { + /* Use the fast variant of SeaBIOS. */ + ADD_CMDLINE ("-bios"); + ADD_CMDLINE ("bios-fast.bin"); + } + /* Add a random number generator (backend for virtio-rng). This * isn't strictly necessary but means we won't need to hang around * when needing entropy. diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c index 05ab6a6..9f76afa 100644 --- a/src/launch-libvirt.c +++ b/src/launch-libvirt.c @@ -1159,6 +1159,15 @@ construct_libvirt_xml_boot (guestfs_h *g, } end_element (); } } +#if defined(__i386__) || defined(__x86_64__) + /* XXX libvirt should provide a way to detect if bios-fast.bin exists */ + else if (guestfs_int_version_ge (¶ms->data->qemu_version, 2, 7, 0)) { + /* Use the fast variant of SeaBIOS. */ + start_element ("loader") { + string ("bios-fast.bin"); + } end_element (); + } +#endif start_element ("kernel") { string (params->kernel); -- 2.7.4