mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
hw/cpu: Call object_class_is_abstract() once in cpu_class_by_name()
Let CPUClass::class_by_name() handlers to return abstract classes, and filter them once in the public cpu_class_by_name() method. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20230908112235.75914-3-philmd@linaro.org>
This commit is contained in:
parent
55f2cd7737
commit
3a9d0d7b64
15 changed files with 27 additions and 36 deletions
|
@ -132,8 +132,7 @@ static ObjectClass *tricore_cpu_class_by_name(const char *cpu_model)
|
|||
typename = g_strdup_printf(TRICORE_CPU_TYPE_NAME("%s"), cpu_model);
|
||||
oc = object_class_by_name(typename);
|
||||
g_free(typename);
|
||||
if (!oc || !object_class_dynamic_cast(oc, TYPE_TRICORE_CPU) ||
|
||||
object_class_is_abstract(oc)) {
|
||||
if (!oc || !object_class_dynamic_cast(oc, TYPE_TRICORE_CPU)) {
|
||||
return NULL;
|
||||
}
|
||||
return oc;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue