diff options
author | Andreas Färber <afaerber@suse.de> | 2013-01-27 20:16:17 +0100 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-02-01 01:35:22 +0100 |
commit | 7a9f812b381639b96a020bdb1f4783f11f886754 (patch) | |
tree | da69722af765a58b23904038e3027179bcda892e /target-m68k/cpu.c | |
parent | 087fe4f824e88d5924bf6887cb59985510a790b7 (diff) |
target-m68k: Rename CPU subtypes
In the initial conversion of CPU models to QOM types, model names were
mapped 1:1 to type names. As a side effect this gained us a type "any",
which is now a device.
To avoid "-device any" silliness and to pave the way for compiling
multiple targets into one executable, adopt a <name>-<arch>-cpu scheme.
No functional changes for -cpu arguments or -cpu ? output.
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'target-m68k/cpu.c')
-rw-r--r-- | target-m68k/cpu.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/target-m68k/cpu.c b/target-m68k/cpu.c index c911b8fa97..c71f715174 100644 --- a/target-m68k/cpu.c +++ b/target-m68k/cpu.c @@ -59,12 +59,15 @@ static void m68k_cpu_reset(CPUState *s) static ObjectClass *m68k_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_M68K_CPU, cpu_model); + oc = object_class_by_name(typename); + g_free(typename); if (oc != NULL && (object_class_dynamic_cast(oc, TYPE_M68K_CPU) == NULL || object_class_is_abstract(oc))) { return NULL; @@ -165,12 +168,13 @@ static void m68k_cpu_class_init(ObjectClass *c, void *data) static void register_cpu_type(const M68kCPUInfo *info) { TypeInfo type_info = { - .name = info->name, .parent = TYPE_M68K_CPU, .instance_init = info->instance_init, }; + type_info.name = g_strdup_printf("%s-" TYPE_M68K_CPU, info->name); type_register(&type_info); + g_free((void *)type_info.name); } static const TypeInfo m68k_cpu_type_info = { |