From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:33139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TlFxp-0001Tv-LW for qemu-devel@nongnu.org; Wed, 19 Dec 2012 04:29:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TlFxo-00031u-CE for qemu-devel@nongnu.org; Wed, 19 Dec 2012 04:29:21 -0500 Date: Wed, 19 Dec 2012 10:29:16 +0100 From: Stefan Hajnoczi Message-ID: <20121219092916.GA5023@stefanha-thinkpad.redhat.com> 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> <87a9tsh8ui.fsf_-_@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a9tsh8ui.fsf_-_@blackfin.pond.sub.org> Subject: Re: [Qemu-devel] [PATCH v2 1/2] pc_sysfw: Check for qemu_find_file() failure List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-trivial@nongnu.org, jordan.l.justen@intel.com, qemu-devel@nongnu.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 > --- > 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