diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 0d7b12dade3bd36cea15210c0d90f1a239415bce..6dac9d3045733d81adc910189a4800b63396d388 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7927,6 +7927,21 @@ qemuBuildCommandLine(virConnectPtr conn, def->os.bios.rt_delay); } + if (def->os.bm_timeout_set) { + if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_SPLASH_TIMEOUT)) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", + _("splash timeout is not supported " + "by this QEMU binary")); + virBufferFreeAndReset(&boot_buf); + goto error; + } + + if (boot_nparams++) + virBufferAddChar(&boot_buf, ','); + + virBufferAsprintf(&boot_buf, "splash-time=%u", def->os.bm_timeout); + } + if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BOOT_STRICT)) { if (boot_nparams++) virBufferAddChar(&boot_buf, ','); diff --git a/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-enable-with-timeout.args b/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-enable-with-timeout.args new file mode 100644 index 0000000000000000000000000000000000000000..6141259136674629fd2246e6d5681fc19a1d500f --- /dev/null +++ b/tests/qemuxml2argvdata/qemuxml2argv-boot-menu-enable-with-timeout.args @@ -0,0 +1,15 @@ +LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test QEMU_AUDIO_DRV=none \ +/usr/bin/qemu \ +-S \ +-M pc \ +-m 214 \ +-smp 1 \ +-nographic \ +-nodefaults \ +-monitor unix:/tmp/test-monitor,server,nowait \ +-no-acpi \ +-boot order=d,menu=on,splash-time=3000 \ +-usb \ +-drive file=/dev/cdrom,if=none,media=cdrom,id=drive-ide0-1-0 \ +-device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \ +-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 6255b51ab9ee3a2411fea042b5499737ed7a0c0f..74072723d345f945fa6a40b2772309854a671f99 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -607,6 +607,10 @@ mymain(void) DO_TEST("boot-menu-enable", QEMU_CAPS_BOOT_MENU, QEMU_CAPS_DEVICE, QEMU_CAPS_DRIVE, QEMU_CAPS_BOOTINDEX); + DO_TEST("boot-menu-enable-with-timeout", + QEMU_CAPS_BOOT_MENU, QEMU_CAPS_DEVICE, + QEMU_CAPS_DRIVE, QEMU_CAPS_SPLASH_TIMEOUT); + DO_TEST_FAILURE("boot-menu-enable-with-timeout", QEMU_CAPS_BOOT_MENU); 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-drive",