summary refs log tree commit diff stats
path: root/target/i386/cpu.c
diff options
context:
space:
mode:
authorGavin Shan <gshan@redhat.com>2023-11-15 09:56:19 +1000
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-01-05 16:20:14 +0100
commit4b26aa9f3a9a1f1e84f95e7462d1b3d893315b91 (patch)
tree0911bee981733b7fa4e0b3c08860fc2671567cbf /target/i386/cpu.c
parentf08f4c8ea46817e8efaad0f36434631b93f86645 (diff)
downloadfocaccia-qemu-4b26aa9f3a9a1f1e84f95e7462d1b3d893315b91.tar.gz
focaccia-qemu-4b26aa9f3a9a1f1e84f95e7462d1b3d893315b91.zip
target: Use generic cpu_model_from_type()
Use generic cpu_model_from_type() when the CPU model name needs to
be extracted from the CPU type name.

Signed-off-by: Gavin Shan <gshan@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20231114235628.534334-23-gshan@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'target/i386/cpu.c')
-rw-r--r--target/i386/cpu.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index fd47ee7def..2524881ce2 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -1744,8 +1744,7 @@ static char *x86_cpu_class_get_model_name(X86CPUClass *cc)
 {
     const char *class_name = object_class_get_name(OBJECT_CLASS(cc));
     assert(g_str_has_suffix(class_name, X86_CPU_TYPE_SUFFIX));
-    return g_strndup(class_name,
-                     strlen(class_name) - strlen(X86_CPU_TYPE_SUFFIX));
+    return cpu_model_from_type(class_name);
 }
 
 typedef struct X86CPUVersionDefinition {