diff mbox series

hw/i386: return an error message when mb magic/pvh note could not be found

Message ID 9939bfcd6fad908c21bbfb751a2896d7@email.mijndomein.nl (mailing list archive)
State New, archived
Headers show
Series hw/i386: return an error message when mb magic/pvh note could not be found | expand

Commit Message

nathan@kolpa.me Feb. 8, 2024, 11:11 a.m. UTC
When using a non-linux kernel where the multiboot magic is
misconfigured the following message would display: "linux kernel too old to load a ram
disk".

This patch instead, displays a more descriptive error message: "could not find multiboot magic or PVH ELF Note". The linux specific boot sequence is skipped because earlier it is asserted that the linux protocol magic field could not be found.

Signed-off-by: Nathan Kolpa <nathan@kolpa.me>
---
 hw/i386/x86.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index 2b6291ad8d..b59f1180f5 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -902,7 +902,10 @@  void x86_load_linux(X86MachineState *x86ms,
 
             return;
         }
-        protocol = 0;
+
+        fprintf(stderr, "qemu: could not find multiboot magic or "
+                "PVH ELF Note.\n");
+        exit(1);
     }
 
     if (protocol < 0x200 || !(header[0x211] & 0x01)) {