aboutsummaryrefslogtreecommitdiff
path: root/hw/pc_sysfw.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/pc_sysfw.c')
-rw-r--r--hw/pc_sysfw.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/hw/pc_sysfw.c b/hw/pc_sysfw.c
index b45f0acc7d..7567593a63 100644
--- a/hw/pc_sysfw.c
+++ b/hw/pc_sysfw.c
@@ -23,15 +23,15 @@
* THE SOFTWARE.
*/
-#include "blockdev.h"
+#include "sysemu/blockdev.h"
#include "sysbus.h"
#include "hw.h"
#include "pc.h"
#include "hw/boards.h"
#include "loader.h"
-#include "sysemu.h"
+#include "sysemu/sysemu.h"
#include "flash.h"
-#include "kvm.h"
+#include "sysemu/kvm.h"
#define BIOS_FILENAME "bios.bin"
@@ -84,6 +84,10 @@ static void pc_fw_add_pflash_drv(void)
bios_name = BIOS_FILENAME;
}
filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
+ if (!filename) {
+ error_report("Can't open BIOS image %s", bios_name);
+ exit(1);
+ }
opts = drive_add(IF_PFLASH, -1, filename, "readonly=on");
@@ -98,7 +102,9 @@ static void pc_fw_add_pflash_drv(void)
return;
}
- drive_init(opts, machine->use_scsi);
+ if (!drive_init(opts, machine->block_default_type)) {
+ qemu_opts_del(opts);
+ }
}
static void pc_system_flash_init(MemoryRegion *rom_memory,
@@ -106,7 +112,7 @@ static void pc_system_flash_init(MemoryRegion *rom_memory,
{
BlockDriverState *bdrv;
int64_t size;
- target_phys_addr_t phys_addr;
+ hwaddr phys_addr;
int sector_bits, sector_size;
pflash_t *system_flash;
MemoryRegion *flash_mem;