From: Jesse Larrew <jlarrew@linux.vnet.ibm.com>
To: liguang <lig.fnst@cn.fujitsu.com>
Cc: qemu-trivial@nongnu.org, Anthony Liguori <aliguori@us.ibm.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH v3] hw/i386/pc: prompt not multboot or morden kernel image
Date: Mon, 08 Apr 2013 23:36:30 -0500 [thread overview]
Message-ID: <51639ACE.8020505@linux.vnet.ibm.com> (raw)
In-Reply-To: <1365474461-17474-1-git-send-email-lig.fnst@cn.fujitsu.com>
On 04/08/2013 09:27 PM, liguang wrote:
> if head magic is missing or wrong unexpectedly, we'd
> better to prompt memssage for this.
> 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.
>
Yes, that message would definitely be misleading in this case.
> Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
> ---
> hw/i386/pc.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index ebbf059..6b29c3f 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -686,6 +686,8 @@ 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, "warn: invalid multiboot or modern kernel image\n");
> }
> protocol = 0;
> }
>
My impression from reading through the code is that this branch can be
legitimately triggered by an older kernel (protocol < 0x200). In that case,
the error message above would also be misleading.
I think a better solution might be to simply validate that the arch
specified in the ELF header matches the arch that qemu is emulating. I'll
look into this more tomorrow morning. :)
Jesse Larrew
Software Engineer, KVM Team
IBM Linux Technology Center
Phone: (512) 973-2052 (T/L: 363-2052)
jlarrew@linux.vnet.ibm.com
WARNING: multiple messages have this Message-ID (diff)
From: Jesse Larrew <jlarrew@linux.vnet.ibm.com>
To: liguang <lig.fnst@cn.fujitsu.com>
Cc: qemu-trivial@nongnu.org, Stefan Hajnoczi <stefanha@gmail.com>,
Anthony Liguori <aliguori@us.ibm.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v3] hw/i386/pc: prompt not multboot or morden kernel image
Date: Mon, 08 Apr 2013 23:36:30 -0500 [thread overview]
Message-ID: <51639ACE.8020505@linux.vnet.ibm.com> (raw)
In-Reply-To: <1365474461-17474-1-git-send-email-lig.fnst@cn.fujitsu.com>
On 04/08/2013 09:27 PM, liguang wrote:
> if head magic is missing or wrong unexpectedly, we'd
> better to prompt memssage for this.
> 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.
>
Yes, that message would definitely be misleading in this case.
> Signed-off-by: liguang <lig.fnst@cn.fujitsu.com>
> ---
> hw/i386/pc.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index ebbf059..6b29c3f 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -686,6 +686,8 @@ 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, "warn: invalid multiboot or modern kernel image\n");
> }
> protocol = 0;
> }
>
My impression from reading through the code is that this branch can be
legitimately triggered by an older kernel (protocol < 0x200). In that case,
the error message above would also be misleading.
I think a better solution might be to simply validate that the arch
specified in the ELF header matches the arch that qemu is emulating. I'll
look into this more tomorrow morning. :)
Jesse Larrew
Software Engineer, KVM Team
IBM Linux Technology Center
Phone: (512) 973-2052 (T/L: 363-2052)
jlarrew@linux.vnet.ibm.com
next prev parent reply other threads:[~2013-04-09 4:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-09 2:27 [Qemu-trivial] [Qemu-devel][PATCH v3] hw/i386/pc: prompt not multboot or morden kernel image liguang
2013-04-09 2:27 ` [Qemu-devel] [PATCH " liguang
2013-04-09 4:36 ` Jesse Larrew [this message]
2013-04-09 4:36 ` Jesse Larrew
2013-04-09 5:05 ` [Qemu-trivial] " li guang
2013-04-09 5:05 ` li guang
2013-04-09 19:15 ` [Qemu-trivial] " Jesse Larrew
2013-04-09 19:15 ` Jesse Larrew
2013-04-11 2:18 ` [Qemu-trivial] " li guang
2013-04-11 2:18 ` li guang
2013-04-12 11:40 ` [Qemu-trivial] " Stefan Hajnoczi
2013-04-12 11:40 ` Stefan Hajnoczi
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=51639ACE.8020505@linux.vnet.ibm.com \
--to=jlarrew@linux.vnet.ibm.com \
--cc=aliguori@us.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.