|
@@ -178,21 +178,13 @@ error:
|
|
|
|
|
|
static void fw_cfg_bootsplash(FWCfgState *s)
|
|
|
{
|
|
|
- const char *boot_splash_filename = NULL;
|
|
|
- const char *boot_splash_time = NULL;
|
|
|
char *filename, *file_data;
|
|
|
gsize file_size;
|
|
|
int file_type;
|
|
|
|
|
|
- /* get user configuration */
|
|
|
- QemuOptsList *plist = qemu_find_opts("boot-opts");
|
|
|
- QemuOpts *opts = QTAILQ_FIRST(&plist->head);
|
|
|
- boot_splash_filename = qemu_opt_get(opts, "splash");
|
|
|
- boot_splash_time = qemu_opt_get(opts, "splash-time");
|
|
|
-
|
|
|
/* insert splash time if user configurated */
|
|
|
- if (boot_splash_time) {
|
|
|
- int64_t bst_val = qemu_opt_get_number(opts, "splash-time", -1);
|
|
|
+ if (current_machine->boot_config.has_splash_time) {
|
|
|
+ int64_t bst_val = current_machine->boot_config.splash_time;
|
|
|
uint16_t bst_le16;
|
|
|
|
|
|
/* validate the input */
|
|
@@ -208,7 +200,8 @@ static void fw_cfg_bootsplash(FWCfgState *s)
|
|
|
}
|
|
|
|
|
|
/* insert splash file if user configurated */
|
|
|
- if (boot_splash_filename) {
|
|
|
+ if (current_machine->boot_config.has_splash) {
|
|
|
+ const char *boot_splash_filename = current_machine->boot_config.splash;
|
|
|
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, boot_splash_filename);
|
|
|
if (filename == NULL) {
|
|
|
error_report("failed to find file '%s'", boot_splash_filename);
|
|
@@ -238,17 +231,11 @@ static void fw_cfg_bootsplash(FWCfgState *s)
|
|
|
|
|
|
static void fw_cfg_reboot(FWCfgState *s)
|
|
|
{
|
|
|
- const char *reboot_timeout = NULL;
|
|
|
uint64_t rt_val = -1;
|
|
|
uint32_t rt_le32;
|
|
|
|
|
|
- /* get user configuration */
|
|
|
- QemuOptsList *plist = qemu_find_opts("boot-opts");
|
|
|
- QemuOpts *opts = QTAILQ_FIRST(&plist->head);
|
|
|
- reboot_timeout = qemu_opt_get(opts, "reboot-timeout");
|
|
|
-
|
|
|
- if (reboot_timeout) {
|
|
|
- rt_val = qemu_opt_get_number(opts, "reboot-timeout", -1);
|
|
|
+ if (current_machine->boot_config.has_reboot_timeout) {
|
|
|
+ rt_val = current_machine->boot_config.reboot_timeout;
|
|
|
|
|
|
/* validate the input */
|
|
|
if (rt_val > 0xffff && rt_val != (uint64_t)-1) {
|
|
@@ -1133,7 +1120,7 @@ static void fw_cfg_common_realize(DeviceState *dev, Error **errp)
|
|
|
fw_cfg_add_bytes(s, FW_CFG_SIGNATURE, (char *)"QEMU", 4);
|
|
|
fw_cfg_add_bytes(s, FW_CFG_UUID, &qemu_uuid, 16);
|
|
|
fw_cfg_add_i16(s, FW_CFG_NOGRAPHIC, (uint16_t)!machine->enable_graphics);
|
|
|
- fw_cfg_add_i16(s, FW_CFG_BOOT_MENU, (uint16_t)boot_menu);
|
|
|
+ fw_cfg_add_i16(s, FW_CFG_BOOT_MENU, (uint16_t)(machine->boot_config.has_menu && machine->boot_config.menu));
|
|
|
fw_cfg_bootsplash(s);
|
|
|
fw_cfg_reboot(s);
|
|
|
|