From: Stefan Hajnoczi <stefanha@gmail.com>
To: liguang <lig.fnst@cn.fujitsu.com>
Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2] hw/i386/pc: reject to boot a wrong header magic kernel
Date: Fri, 5 Apr 2013 14:59:41 +0200 [thread overview]
Message-ID: <20130405125941.GD15818@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1364779317-3963-1-git-send-email-lig.fnst@cn.fujitsu.com>
On Mon, Apr 01, 2013 at 09:21:57AM +0800, liguang wrote:
> if head magic is missing or wrong unexpectedly, we'd
> better to reject booting.
> e.g.
> I make a mistake to boot a vmlinuz for MIPS(which
> I think it's for x86) like this:
> qemu-system-x86_64 -kernel vmlinuz -initrd demord
> then qemu report:
> "qemu: linux kernel too old to load a ram disk"
> that's misleading.
>
> Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
> ---
> hw/i386/pc.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index b1e06fa..bfbb5fe 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -683,6 +683,9 @@ static void load_linux(void *fw_cfg,
> if (load_multiboot(fw_cfg, f, kernel_filename, initrd_filename,
> kernel_cmdline, kernel_size, header)) {
> return;
> + } else {
> + fprintf(stderr, "not a valid multiboot image!\n");
> + exit(1);
> }
> protocol = 0;
The point of protocol = 0 is to support old Linux kernels. If we exit
when probing load_multiboot() fails then QEMU will no longer load old
Linux kernels!
I suggest just:
fprintf(stderr, "warning: not a valid multiboot or modern kernel image\n");
Stefan
next prev parent reply other threads:[~2013-04-05 12:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-01 1:21 [Qemu-devel] [PATCH v2] hw/i386/pc: reject to boot a wrong header magic kernel liguang
2013-04-05 12:59 ` Stefan Hajnoczi [this message]
2013-04-08 0:13 ` li guang
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=20130405125941.GD15818@stefanha-thinkpad.redhat.com \
--to=stefanha@gmail.com \
--cc=lig.fnst@cn.fujitsu.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@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).