summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Huth2015-05-07 07:33:40 +0200
committerAlexander Graf2015-06-03 23:56:52 +0200
commit68fea5a0d7bac17fd74f0608ceed1d914eb0718e (patch)
treef06e6b49cf1f92e7c0ed12dfb37fde32bddc63b5
parentpseries: Add pseries-2.4 machine type (diff)
downloadqemu-68fea5a0d7bac17fd74f0608ceed1d914eb0718e.tar.gz
qemu-68fea5a0d7bac17fd74f0608ceed1d914eb0718e.tar.xz
qemu-68fea5a0d7bac17fd74f0608ceed1d914eb0718e.zip
hw/ppc/spapr: Fix error message when firmware could not be loaded
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 <thuth@redhat.com> Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Alexander Graf <agraf@suse.de>
-rw-r--r--hw/ppc/spapr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 971cb5f85c..9c05787942 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);