From: Stefan Hajnoczi <stefanha@gmail.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-trivial@nongnu.org, jordan.l.justen@intel.com,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 1/2] pc_sysfw: Check for qemu_find_file() failure
Date: Wed, 19 Dec 2012 10:29:16 +0100 [thread overview]
Message-ID: <20121219092916.GA5023@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <87a9tsh8ui.fsf_-_@blackfin.pond.sub.org>
On Wed, Dec 05, 2012 at 03:28:05PM +0100, Markus Armbruster wrote:
> pc_fw_add_pflash_drv() ignores qemu_find_file() failure, and happily
> creates a drive without a medium.
>
> When pc_system_flash_init() asks for its size, bdrv_getlength() fails
> with -ENOMEDIUM, which isn't checked either. It fails relatively
> cleanly only because -ENOMEDIUM isn't a multiple of 4096:
>
> $ qemu-system-x86_64 -S -vnc :0 -bios nonexistant
> qemu: PC system firmware (pflash) must be a multiple of 0x1000
> [Exit 1 ]
>
> Fix by handling the qemu_find_file() failure.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
> v2: Don't report errno, because that can produce misleading error
> messages. For instance, when "seabios/out/bios.bin" is unreadable, we
> fall back to $data_dir/seabios/out/bios.bin, which doesn't exist, and
> then report "seabios/out/bios.bin: No such file or directory". No other
> caller reports errno.
>
> hw/pc_sysfw.c | 4 ++++
> 1 file changed, 4 insertions(+)
Thanks, applied to the trivial patches tree:
https://github.com/stefanha/qemu/commits/trivial-patches
Stefan
next prev parent reply other threads:[~2012-12-19 9:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-23 18:12 [Qemu-devel] [PATCH 0/2] pc_fw_add_pflash_drv() fixes Markus Armbruster
2012-11-23 18:12 ` [Qemu-devel] [PATCH 1/2] pc_sysfw: Check for qemu_find_file() failure Markus Armbruster
2012-12-03 13:05 ` [Qemu-devel] [Qemu-trivial] " Stefan Hajnoczi
2012-12-03 13:21 ` Markus Armbruster
2012-12-05 14:28 ` [Qemu-devel] [PATCH v2 " Markus Armbruster
2012-12-19 9:29 ` Stefan Hajnoczi [this message]
2012-11-23 18:12 ` [Qemu-devel] [PATCH 2/2] pc_sysfw: Plug memory leak on pc_fw_add_pflash_drv() error path Markus Armbruster
2012-12-03 13:06 ` 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=20121219092916.GA5023@stefanha-thinkpad.redhat.com \
--to=stefanha@gmail.com \
--cc=armbru@redhat.com \
--cc=jordan.l.justen@intel.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).