aboutsummaryrefslogtreecommitdiff
path: root/target-openrisc
diff options
context:
space:
mode:
authorAndreas Färber <afaerber@suse.de>2013-01-23 12:39:38 +0100
committerAndreas Färber <afaerber@suse.de>2013-01-28 16:54:48 +0100
commitc432b7840cfbc35fc0d097428d0a2f2a94983360 (patch)
tree99c46fb4b683d3529a740ea80754c7873bedb2c8 /target-openrisc
parentcae85065a44b731467dc6a5caee7cfc6d26d9ca3 (diff)
target-openrisc: Catch attempt to instantiate abstract type in cpu_init()
There is no abstract OpenRISCCPU yet, but that seems a bug of its own. Cc: qemu-stable@nongnu.org Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-openrisc')
-rw-r--r--target-openrisc/cpu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/target-openrisc/cpu.c b/target-openrisc/cpu.c
index e23100fa09..adc03ef779 100644
--- a/target-openrisc/cpu.c
+++ b/target-openrisc/cpu.c
@@ -98,7 +98,8 @@ static ObjectClass *openrisc_cpu_class_by_name(const char *cpu_model)
}
oc = object_class_by_name(cpu_model);
- if (oc != NULL && !object_class_dynamic_cast(oc, TYPE_OPENRISC_CPU)) {
+ if (oc != NULL && (!object_class_dynamic_cast(oc, TYPE_OPENRISC_CPU) ||
+ object_class_is_abstract(oc))) {
return NULL;
}
return oc;