From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Cc: Rob Herring <rob.herring@linaro.org>, patches@linaro.org
Subject: [Qemu-devel] [for-2.0 1/2] hw/arm/highbank: Don't segfault on unknown CPU names
Date: Thu, 3 Apr 2014 14:56:27 +0100 [thread overview]
Message-ID: <1396533388-12069-2-git-send-email-peter.maydell@linaro.org> (raw)
In-Reply-To: <1396533388-12069-1-git-send-email-peter.maydell@linaro.org>
If the user passes an unknown CPU name via the '-cpu' option, exit
with an error message rather than segfaulting.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
hw/arm/highbank.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/hw/arm/highbank.c b/hw/arm/highbank.c
index f66d57b..03545aa 100644
--- a/hw/arm/highbank.c
+++ b/hw/arm/highbank.c
@@ -233,6 +233,11 @@ static void calxeda_init(QEMUMachineInitArgs *args, enum cxmachines machine)
ARMCPU *cpu;
Error *err = NULL;
+ if (!oc) {
+ fprintf(stderr, "Unable to find CPU definition\n");
+ exit(1);
+ }
+
cpu = ARM_CPU(object_new(object_class_get_name(oc)));
object_property_set_int(OBJECT(cpu), MPCORE_PERIPHBASE, "reset-cbar",
--
1.9.0
next prev parent reply other threads:[~2014-04-03 13:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-03 13:56 [Qemu-devel] [for-2.0 0/2] A15 board bugfixes Peter Maydell
2014-04-03 13:56 ` Peter Maydell [this message]
2014-04-03 15:48 ` [Qemu-devel] [for-2.0 1/2] hw/arm/highbank: Don't segfault on unknown CPU names Andreas Färber
2014-04-03 13:56 ` [Qemu-devel] [for-2.0 2/2] hw/arm/vexpress, hw/arm/highbank: Don't insist that CPU has reset-cbar property Peter Maydell
2014-04-03 14:25 ` [Qemu-devel] [for-2.0 0/2] A15 board bugfixes Rob Herring
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=1396533388-12069-2-git-send-email-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=patches@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rob.herring@linaro.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).