"ide-drive.wwn",
"scsi-disk.wwn",
"seccomp-sandbox",
+
+ "reboot-timeout", /* 110 */
);
struct _qemuCaps {
qemuCapsSet(caps, QEMU_CAPS_NESTING);
if (strstr(help, ",menu=on"))
qemuCapsSet(caps, QEMU_CAPS_BOOT_MENU);
+ if (strstr(help, ",reboot-timeout=rb_time"))
+ qemuCapsSet(caps, QEMU_CAPS_REBOOT_TIMEOUT);
if ((fsdev = strstr(help, "-fsdev"))) {
qemuCapsSet(caps, QEMU_CAPS_FSDEV);
if (strstr(fsdev, "readonly"))
QEMU_CAPS_IDE_DRIVE_WWN = 107, /* Is ide-drive.wwn available? */
QEMU_CAPS_SCSI_DISK_WWN = 108, /* Is scsi-disk.wwn available? */
QEMU_CAPS_SECCOMP_SANDBOX = 109, /* -sandbox */
+ QEMU_CAPS_REBOOT_TIMEOUT = 110, /* -boot reboot-timeout */
QEMU_CAPS_LAST, /* this must always be the last item */
};
VIR_WARN("bootmenu is enabled but not "
"supported by this QEMU binary");
}
+ }
+
+ if (def->os.bios.rt_set) {
+ if (!qemuCapsGet(caps, QEMU_CAPS_REBOOT_TIMEOUT)) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("reboot timeout is not supported "
+ "by this QEMU binary"));
+ goto error;
+ }
+
+ if (boot_nparams++)
+ virBufferAddChar(&boot_buf, ',');
+ virBufferAsprintf(&boot_buf,
+ "reboot-timeout=%d",
+ def->os.bios.rt_delay);
}
if (boot_nparams > 0) {
qemuParseCommandLineBootDevs(def, token);
} else if (STRPREFIX(token, "menu=on")) {
def->os.bootmenu = 1;
+ } else if (STRPREFIX(token, "reboot-timeout=")) {
+ int num;
+ char *endptr;
+ if (virStrToLong_i(token + strlen("reboot-timeout="),
+ &endptr, 10, &num) < 0 ||
+ (*endptr != '\0' && endptr != strchr(token, ','))) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot parse reboot-timeout value"));
+ goto error;
+ }
+ if (num > 65535)
+ num = 65535;
+ else if (num < -1)
+ num = -1;
+ def->os.bios.rt_delay = num;
+ def->os.bios.rt_set = true;
}
token = strchr(token, ',');
/* This incrementation has to be done here in order to make it