Patchwork [v2,2/5] S390: BIOS check for file

login
register
mail settings
Submitter Dominik Dingel
Date April 29, 2013, 2:52 p.m.
Message ID <1367247128-22409-3-git-send-email-dingel@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/240385/
State New
Headers show

Comments

Dominik Dingel - April 29, 2013, 2:52 p.m.
Add a check if the BIOS blob exists before trying to load.

Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>
Alexander Graf - April 30, 2013, 10:23 a.m.
On 29.04.2013, at 16:52, Dominik Dingel wrote:

> Add a check if the BIOS blob exists before trying to load.
> 
> Signed-off-by: Dominik Dingel <dingel@linux.vnet.ibm.com>

Thanks, applied to s390-next.


Alex

> 
> diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
> index bcbba7c..f7a570e 100644
> --- a/hw/s390x/ipl.c
> +++ b/hw/s390x/ipl.c
> @@ -93,6 +93,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) {
> -- 
> 1.7.9.5
>

Patch

diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
index bcbba7c..f7a570e 100644
--- a/hw/s390x/ipl.c
+++ b/hw/s390x/ipl.c
@@ -93,6 +93,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) {