qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vishal Chourasia <vishalc@linux.ibm.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: npiggin@gmail.com, adityag@linux.ibm.com, milesg@linux.ibm.com,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH] hw/ppc/pnv: Improve kernel/initrd load failure error messages
Date: Mon, 13 Oct 2025 12:31:58 +0530	[thread overview]
Message-ID: <aOyj5p2xzoxCyYZC@linux.ibm.com> (raw)
In-Reply-To: <CAFEAcA8VWKEy3XVo3b9pTg-jCAD2oA7=dFbOSRL3q+WRUoNBpA@mail.gmail.com>

On Tue, Oct 07, 2025 at 02:29:52PM +0100, Peter Maydell wrote:
> On Tue, 7 Oct 2025 at 13:59, Vishal Chourasia <vishalc@linux.ibm.com> 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.
Hello Peter,

Wouldn't it be better to print the error inside the function itself.

Thanks
vishalc
> 
> thanks
> -- PMM
> 


  reply	other threads:[~2025-10-13  7:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-07  9:12 [PATCH] hw/ppc/pnv: Improve kernel/initrd load failure error messages Vishal Chourasia
2025-10-07 13:29 ` Peter Maydell
2025-10-13  7:01   ` Vishal Chourasia [this message]
2025-10-13  8:35     ` Peter Maydell
2025-10-13 10:18       ` Aditya Gupta
2025-10-13 10:37         ` Peter Maydell
2025-10-13 10:54           ` Harsh Prateek Bora
2025-10-13  9:50     ` Vishal Chourasia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aOyj5p2xzoxCyYZC@linux.ibm.com \
    --to=vishalc@linux.ibm.com \
    --cc=adityag@linux.ibm.com \
    --cc=milesg@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).