From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39489) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yo4eA-0008N2-4N for qemu-devel@nongnu.org; Fri, 01 May 2015 02:42:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yo4e6-0001IU-4U for qemu-devel@nongnu.org; Fri, 01 May 2015 02:42:02 -0400 From: David Gibson Date: Fri, 1 May 2015 16:41:32 +1000 Message-Id: <1430462510-14195-15-git-send-email-david@gibson.dropbear.id.au> In-Reply-To: <1430462510-14195-1-git-send-email-david@gibson.dropbear.id.au> References: <1430462510-14195-1-git-send-email-david@gibson.dropbear.id.au> Subject: [Qemu-devel] [PATCH 14/32] hw/ppc/spapr: Fix error message when firmware could not be loaded List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: agraf@suse.de Cc: Thomas Huth , qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com, qemu-ppc@nongnu.org, afaerber@suse.de, David Gibson From: Thomas Huth When specifying a non-existing file with the "-bios" parameter, QEMU complained that it "could not find LPAR rtas". That's obviously a copy-n-paste bug from the code which loads the spapr-rtas.bin, it should complain about a missing firmware file instead. Additionally the error message was printed with hw_error() - which also dumps the whole CPU state. However, this does not make much sense here since the CPU is not running yet and thus the registers only contain zeroes. So let's use error_report() here instead. And while we're at it, let's also bail out if the firmware file had zero length. Signed-off-by: Thomas Huth Signed-off-by: David Gibson --- hw/ppc/spapr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 30ed494..ced455e 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1641,12 +1641,12 @@ static void ppc_spapr_init(MachineState *machine) } filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); if (!filename) { - hw_error("Could not find LPAR rtas '%s'\n", bios_name); + error_report("Could not find LPAR firmware '%s'", bios_name); exit(1); } fw_size = load_image_targphys(filename, 0, FW_MAX_SIZE); - if (fw_size < 0) { - hw_error("qemu: could not load LPAR rtas '%s'\n", filename); + if (fw_size <= 0) { + error_report("Could not load LPAR firmware '%s'", filename); exit(1); } g_free(filename); -- 2.1.0