On Tue, 7 Oct 2025 at 13:59, Vishal Chourasia <[email protected]> wrote:
>
> When QEMU fails to load the kernel or initrd image, it previously emitted
> a generic error message such as:
>
> qemu-system-ppc64: Could not load kernel 'vmlinux'
>
> This provides little context on why the failure occurred, which can make
> debugging difficult, especially for new users or when dealing with large
> images.
>
> The new messages also include the configured size limits (in MiB) to help
> users verify that their image files are within acceptable bounds.
> if (kernel_size < 0) {
> error_report("Could not load kernel '%s'",
> machine->kernel_filename);
> + error_report(
> + "Possible reasons: file not found, permission denied, or
> size "
> + "exceeds the maximum supported limit (%ld MiB).",
> + KERNEL_MAX_SIZE / 1024 / 1024);
> exit(1);
> }
Rather than printing a list of reasons why the load might
have failed, I think it would be better if we enhanced
the error handling in load_image_targphys() and friends
(i.e. use Error), so that these functions can report back
to the caller exactly why they failed and then the caller
can give that error message to the user. That way we can
improve the error reporting for every board that uses
these load functions.
thanks
-- PMM