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] [Qemu-trivial] [PATCH 1/2] pc_sysfw: Check for qemu_find_file() failure
Date: Mon, 3 Dec 2012 14:05:53 +0100 [thread overview]
Message-ID: <20121203130553.GG6048@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1353694338-13162-2-git-send-email-armbru@redhat.com>
On Fri, Nov 23, 2012 at 07:12:17PM +0100, Markus Armbruster wrote:
> diff --git a/hw/pc_sysfw.c b/hw/pc_sysfw.c
> index 9d7c5f4..066c4fe 100644
> --- a/hw/pc_sysfw.c
> +++ b/hw/pc_sysfw.c
> @@ -84,6 +84,11 @@ static void pc_fw_add_pflash_drv(void)
> bios_name = BIOS_FILENAME;
> }
> filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
> + if (!filename) {
> + error_report("Can't open BIOS image %s: %s",
> + bios_name, strerror(errno));
qemu_find_file() does not document that errno is set when returning
NULL. I can't find other callers to qemu_find_file() that use errno
either.
Please add a doc comment to qemu_find_file() that errno will be set on
NULL return, otherwise we can't rely on it in the caller.
Stefan
next prev parent reply other threads:[~2012-12-03 13:06 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 ` Stefan Hajnoczi [this message]
2012-12-03 13:21 ` [Qemu-devel] [Qemu-trivial] " Markus Armbruster
2012-12-05 14:28 ` [Qemu-devel] [PATCH v2 " Markus Armbruster
2012-12-19 9:29 ` Stefan Hajnoczi
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=20121203130553.GG6048@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).