Commit 35e21d3f authored by Andreas Färber's avatar Andreas Färber Committed by Alexander Graf
Browse files

target-ppc: Report CPU aliases for QMP

The QMP query-cpu-definitions implementation iterated over CPU classes
only, which were getting less and less as aliases were extracted.

Keep them in QMP as valid -cpu arguments even if not guaranteed stable.
Signed-off-by: default avatarAndreas Färber <>
Signed-off-by: default avatarAlexander Graf <>
parent 55d3d1a4
......@@ -8469,11 +8469,32 @@ CpuDefinitionInfoList *arch_query_cpu_definitions(Error **errp)
CpuDefinitionInfoList *cpu_list = NULL;
GSList *list;
int i;
list = object_class_get_list(TYPE_POWERPC_CPU, false);
g_slist_foreach(list, ppc_cpu_defs_entry, &cpu_list);
for (i = 0; i < ARRAY_SIZE(ppc_cpu_aliases); i++) {
const PowerPCCPUAlias *alias = &ppc_cpu_aliases[i];
ObjectClass *oc;
CpuDefinitionInfoList *entry;
CpuDefinitionInfo *info;
oc = ppc_cpu_class_by_name(alias->model);
if (oc == NULL) {
info = g_malloc0(sizeof(*info));
info->name = g_strdup(alias->alias);
entry = g_malloc0(sizeof(*entry));
entry->value = info;
entry->next = cpu_list;
cpu_list = entry;
return cpu_list;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment