Received: from eggs.gnu.org ([208.118.235.92]:44473) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TfVxg-0003Yw-Ea for qemu-devel@nongnu.org; Mon, 03 Dec 2012 08:21:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TfVxa-0008Ef-Jv for qemu-devel@nongnu.org; Mon, 03 Dec 2012 08:21:28 -0500 From: Markus Armbruster References: <1353694338-13162-1-git-send-email-armbru@redhat.com> <1353694338-13162-2-git-send-email-armbru@redhat.com> <20121203130553.GG6048@stefanha-thinkpad.redhat.com> Date: Mon, 03 Dec 2012 14:21:12 +0100 In-Reply-To: <20121203130553.GG6048@stefanha-thinkpad.redhat.com> (Stefan Hajnoczi's message of "Mon, 3 Dec 2012 14:05:53 +0100") Message-ID: <87sj7nz2yf.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH 1/2] pc_sysfw: Check for qemu_find_file() failure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-trivial@nongnu.org, jordan.l.justen@intel.com, qemu-devel@nongnu.org Stefan Hajnoczi writes: > 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. Good point, v2 coming.