From e1e28ba62eb9a44dc83c9e23c81829c72adac8f2 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Sun, 18 Apr 2021 22:19:49 -0700 Subject: [PATCH] xbox: Replace bios_name global with MachineState->firmware field --- hw/xbox/xbox.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/xbox/xbox.c b/hw/xbox/xbox.c index 2098c5c63f..34ca50e85b 100644 --- a/hw/xbox/xbox.c +++ b/hw/xbox/xbox.c @@ -61,14 +61,13 @@ #define MAX_IDE_BUS 2 /* FIXME: Clean this up and propagate errors to UI */ -static void xbox_flash_init(MemoryRegion *rom_memory) +static void xbox_flash_init(MachineState *ms, MemoryRegion *rom_memory) { const uint32_t rom_start = 0xFF000000; + const char *bios_name; /* Locate BIOS ROM image */ - if (bios_name == NULL) { - bios_name = "bios.bin"; - } + bios_name = ms->firmware ?: "bios.bin"; int failed_to_load_bios = 1; char *filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); @@ -198,7 +197,7 @@ static void xbox_memory_init(PCMachineState *pcms, *ram_memory = ram; memory_region_add_subregion(system_memory, 0, ram); - xbox_flash_init(rom_memory); + xbox_flash_init(machine, rom_memory); pc_system_flash_cleanup_unused(pcms); }