}
if (def->os.bios.rt_set) {
- if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_REBOOT_TIMEOUT)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
- _("reboot timeout is not supported "
- "by this QEMU binary"));
- return -1;
- }
-
virBufferAsprintf(&boot_buf,
"reboot-timeout=%d,",
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"));
- return -1;
- }
-
+ if (def->os.bm_timeout_set)
virBufferAsprintf(&boot_buf, "splash-time=%u,", def->os.bm_timeout);
- }
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_BOOT_STRICT))
virBufferAddLit(&boot_buf, "strict=on,");
}
+static int
+qemuDomainDefValidateBoot(const virDomainDef *def,
+ virQEMUCapsPtr qemuCaps)
+{
+ if (def->os.bios.rt_set) {
+ if (!virQEMUCapsGet(qemuCaps, QEMU_CAPS_REBOOT_TIMEOUT)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("reboot timeout is not supported "
+ "by this QEMU binary"));
+ return -1;
+ }
+ }
+
+ 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"));
+ return -1;
+ }
+ }
+
+ return 0;
+}
+
+
static int
qemuDomainDefValidate(const virDomainDef *def,
void *opaque)
if (qemuDomainDefValidatePM(def, qemuCaps) < 0)
goto cleanup;
+ if (qemuDomainDefValidateBoot(def, qemuCaps) < 0)
+ goto cleanup;
+
/* QEMU 2.7 (detected via the availability of query-hotpluggable-cpus)
* enforces stricter rules than previous versions when it comes to guest
* CPU topology. Verify known constraints are respected */
DO_TEST("boot-menu-enable", NONE);
DO_TEST("boot-menu-enable-with-timeout",
QEMU_CAPS_SPLASH_TIMEOUT);
- DO_TEST_FAILURE("boot-menu-enable-with-timeout", NONE);
+ DO_TEST_PARSE_ERROR("boot-menu-enable-with-timeout", NONE);
DO_TEST_PARSE_ERROR("boot-menu-enable-with-timeout-invalid", NONE);
DO_TEST("boot-menu-disable", NONE);
DO_TEST("boot-menu-disable-drive", NONE);
DO_TEST("reboot-timeout-disabled", QEMU_CAPS_REBOOT_TIMEOUT);
DO_TEST("reboot-timeout-enabled", QEMU_CAPS_REBOOT_TIMEOUT);
- DO_TEST_FAILURE("reboot-timeout-enabled", NONE);
+ DO_TEST_PARSE_ERROR("reboot-timeout-enabled", NONE);
DO_TEST("bios",
QEMU_CAPS_DEVICE_ISA_SERIAL,
QEMU_CAPS_DEVICE_IOH3420,
QEMU_CAPS_ICH9_AHCI);
DO_TEST("boot-multi", NONE);
- DO_TEST("boot-menu-enable-with-timeout", NONE);
+ DO_TEST("boot-menu-enable-with-timeout", QEMU_CAPS_SPLASH_TIMEOUT);
DO_TEST("boot-menu-disable", NONE);
DO_TEST("boot-menu-disable-with-timeout", NONE);
DO_TEST("boot-order", NONE);
- DO_TEST("reboot-timeout-enabled", NONE);
- DO_TEST("reboot-timeout-disabled", NONE);
+ DO_TEST("reboot-timeout-enabled", QEMU_CAPS_REBOOT_TIMEOUT);
+ DO_TEST("reboot-timeout-disabled", QEMU_CAPS_REBOOT_TIMEOUT);
DO_TEST("clock-utc", NONE);
DO_TEST("clock-localtime", NONE);