summaryrefslogtreecommitdiff
path: root/target-openrisc
diff options
context:
space:
mode:
Diffstat (limited to 'target-openrisc')
-rw-r--r--target-openrisc/cpu.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/target-openrisc/cpu.c b/target-openrisc/cpu.c
index fd90d370ba..d38c28b2f3 100644
--- a/target-openrisc/cpu.c
+++ b/target-openrisc/cpu.c
@@ -96,12 +96,14 @@ static void openrisc_cpu_initfn(Object *obj)
static ObjectClass *openrisc_cpu_class_by_name(const char *cpu_model)
{
ObjectClass *oc;
+ char *typename;
if (cpu_model == NULL) {
return NULL;
}
- oc = object_class_by_name(cpu_model);
+ typename = g_strdup_printf("%s-" TYPE_OPENRISC_CPU, cpu_model);
+ oc = object_class_by_name(typename);
if (oc != NULL && (!object_class_dynamic_cast(oc, TYPE_OPENRISC_CPU) ||
object_class_is_abstract(oc))) {
return NULL;