diff options
author | Dongxue Zhang <elta.era@gmail.com> | 2013-07-02 17:11:55 +0800 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-07-09 19:09:56 +0200 |
commit | 071b3364e7995036816aa4ebf80ecfa04b1a31de (patch) | |
tree | 693f9bf0f43c95d4260dde02a9c55a7a420d0d9f /target-openrisc/cpu.c | |
parent | dc11549ec213f85f6a024c7df68d349464cd1688 (diff) |
target-openrisc: Fix typename in openrisc_cpu_class_by_name()
Commit 478032a93d908e59085c1ac56f10979942e7dc4f (target-openrisc:
Rename CPU subtypes) suffixed CPU sub-types with "-or32-cpu" but forgot
to update openrisc_cpu_class_by_name(), so that it was still looking for
the types without suffix.
Make target-openrisc running OK by adding the suffix to the model name.
This means it is no longer possible to use -cpu or1200-or32-cpu or
-cpu any-or32-cpu though.
Cc: qemu-stable@nongnu.org
Signed-off-by: Dongxue Zhang <elta.era@gmail.com>
Tested-by: Jia Liu <proljc@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-openrisc/cpu.c')
-rw-r--r-- | target-openrisc/cpu.c | 4 |
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; |