On 25/10/24 10:57AM, Vishal Chourasia wrote:
> Pass error_fatal to load_image_targphys() calls in ppc machine initialization
> to capture detailed error information when loading firmware, kernel,
> and initrd images.
> 
> Passing error_fatal automatically reports detailed error messages and
> exits immediately on failure. Eliminating redundant exit(1) calls, as
> error_fatal handles termination
> 
> The behavior remains functionally identical, but error messages now
> come directly from the loader function with more context about the
> failure cause.
> 
> Signed-off-by: Vishal Chourasia <[email protected]>

Thanks, the errors are much clearer now:

        $ ./build/qemu-system-ppc64 -M powernv -kernel ./vmlinux                
                                     
        qemu-system-ppc64: <...>/vmlinux exceeds maximum image size (128 MiB)
        
        $ ./build/qemu-system-ppc64 -M powernv -kernel ./vmlinux
        qemu-system-ppc64: Could not open '<...>/vmlinux': Permission denied
        
        $ ./build/qemu-system-ppc64 -M powernv -kernel ./vmlinux
        qemu-system-ppc64: Could not open '<...>/vmlinux': No such file or 
directory

Have few observations below, but the patch looks good to me.

Reviewed-by: Aditya Gupta <[email protected]>

>
> > <...snip...>
> diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
> index 004efc6b97..951de4bae4 100644
> --- a/hw/ppc/mac_newworld.c
> +++ b/hw/ppc/mac_newworld.c
> @@ -189,7 +189,7 @@ static void ppc_core99_init(MachineState *machine)
>          if (bios_size <= 0) {
>              /* or load binary ROM image */
>              bios_size = load_image_targphys(filename, PROM_BASE, PROM_SIZE,
> -                                            NULL);
> +                                            &error_fatal);

Nit: This and few similar diffs below change the behaviour.
Previously qemu wouldn't have exited here, but now it will.

This looks okay to me, as considering the code, it must successfully
load these images.

Thanks,
- Aditya G


Reply via email to