qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Vishal Chourasia <vishalc@linux.ibm.com>
To: npiggin@gmail.com, adityag@linux.ibm.com, milesg@linux.ibm.com,
	qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Cc: Vishal Chourasia <vishalc@linux.ibm.com>
Subject: [PATCH] hw/ppc/pnv: Improve kernel/initrd load failure error messages
Date: Tue,  7 Oct 2025 14:42:15 +0530	[thread overview]
Message-ID: <20251007091214.403430-2-vishalc@linux.ibm.com> (raw)

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.

Signed-off-by: Vishal Chourasia <vishalc@linux.ibm.com>
---
 hw/ppc/pnv.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/hw/ppc/pnv.c b/hw/ppc/pnv.c
index f0469cdb8b..dbecb721c1 100644
--- a/hw/ppc/pnv.c
+++ b/hw/ppc/pnv.c
@@ -1084,6 +1084,10 @@ static void pnv_init(MachineState *machine)
         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);
         }
     }
@@ -1096,6 +1100,10 @@ static void pnv_init(MachineState *machine)
         if (pnv->initrd_size < 0) {
             error_report("Could not load initial ram disk '%s'",
                          machine->initrd_filename);
+            error_report(
+                "Possible reasons: file not found, permission denied, or size "
+                "exceeds the maximum supported limit (%ld MiB).",
+                INITRD_MAX_SIZE / 1024 / 1024);
             exit(1);
         }
     }
-- 
2.51.0



             reply	other threads:[~2025-10-07 12:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-07  9:12 Vishal Chourasia [this message]
2025-10-07 13:29 ` [PATCH] hw/ppc/pnv: Improve kernel/initrd load failure error messages Peter Maydell
2025-10-13  7:01   ` Vishal Chourasia
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=20251007091214.403430-2-vishalc@linux.ibm.com \
    --to=vishalc@linux.ibm.com \
    --cc=adityag@linux.ibm.com \
    --cc=milesg@linux.ibm.com \
    --cc=npiggin@gmail.com \
    --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).