S390: BIOS check for file
authorDominik Dingel <dingel@linux.vnet.ibm.com>
Mon, 29 Apr 2013 04:52:05 +0000 (04:52 +0000)
committerAlexander Graf <agraf@suse.de>
Mon, 6 May 2013 15:30:00 +0000 (17:30 +0200)
Add a check if the BIOS blob exists before trying to load.

Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
hw/s390x/ipl.c

index ace5ff50d1784992d1f5e8a9f8101bcc0b8b427a..cc3cd2352b8e398fc67d962f68725c1779092179 100644 (file)
@@ -82,6 +82,10 @@ static int s390_ipl_init(SysBusDevice *dev)
         }
 
         bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
+        if (bios_filename == NULL) {
+            hw_error("could not find stage1 bootloader\n");
+        }
+
         bios_size = load_elf(bios_filename, NULL, NULL, &ipl->start_addr, NULL,
                              NULL, 1, ELF_MACHINE, 0);
         if (bios_size == -1UL) {