cpu.c (75ee62ac606bfc9eb59310b9446df3434bf6e8c2) cpu.c (54aa3de72ea2aaa2e903e7e879a4f3dda515a00e)
1/*
2 * i386 CPUID helper functions
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either

--- 5000 unchanged lines hidden (view full) ---

5009 g_list_free(names);
5010}
5011
5012static void x86_cpu_definition_entry(gpointer data, gpointer user_data)
5013{
5014 ObjectClass *oc = data;
5015 X86CPUClass *cc = X86_CPU_CLASS(oc);
5016 CpuDefinitionInfoList **cpu_list = user_data;
1/*
2 * i386 CPUID helper functions
3 *
4 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either

--- 5000 unchanged lines hidden (view full) ---

5009 g_list_free(names);
5010}
5011
5012static void x86_cpu_definition_entry(gpointer data, gpointer user_data)
5013{
5014 ObjectClass *oc = data;
5015 X86CPUClass *cc = X86_CPU_CLASS(oc);
5016 CpuDefinitionInfoList **cpu_list = user_data;
5017 CpuDefinitionInfoList *entry;
5018 CpuDefinitionInfo *info;
5019
5020 info = g_malloc0(sizeof(*info));
5021 info->name = x86_cpu_class_get_model_name(cc);
5022 x86_cpu_class_check_missing_features(cc, &info->unavailable_features);
5023 info->has_unavailable_features = true;
5024 info->q_typename = g_strdup(object_class_get_name(oc));
5025 info->migration_safe = cc->migration_safe;

--- 8 unchanged lines hidden (view full) ---

5034 * Old machine types won't report aliases, so that alias translation
5035 * doesn't break compatibility with previous QEMU versions.
5036 */
5037 if (default_cpu_version != CPU_VERSION_LEGACY) {
5038 info->alias_of = x86_cpu_class_get_alias_of(cc);
5039 info->has_alias_of = !!info->alias_of;
5040 }
5041
5017 CpuDefinitionInfo *info;
5018
5019 info = g_malloc0(sizeof(*info));
5020 info->name = x86_cpu_class_get_model_name(cc);
5021 x86_cpu_class_check_missing_features(cc, &info->unavailable_features);
5022 info->has_unavailable_features = true;
5023 info->q_typename = g_strdup(object_class_get_name(oc));
5024 info->migration_safe = cc->migration_safe;

--- 8 unchanged lines hidden (view full) ---

5033 * Old machine types won't report aliases, so that alias translation
5034 * doesn't break compatibility with previous QEMU versions.
5035 */
5036 if (default_cpu_version != CPU_VERSION_LEGACY) {
5037 info->alias_of = x86_cpu_class_get_alias_of(cc);
5038 info->has_alias_of = !!info->alias_of;
5039 }
5040
5042 entry = g_malloc0(sizeof(*entry));
5043 entry->value = info;
5044 entry->next = *cpu_list;
5045 *cpu_list = entry;
5041 QAPI_LIST_PREPEND(*cpu_list, info);
5046}
5047
5048CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp)
5049{
5050 CpuDefinitionInfoList *cpu_list = NULL;
5051 GSList *list = get_sorted_cpu_model_list();
5052 g_slist_foreach(list, x86_cpu_definition_entry, &cpu_list);
5053 g_slist_free(list);

--- 2375 unchanged lines hidden ---
5042}
5043
5044CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp)
5045{
5046 CpuDefinitionInfoList *cpu_list = NULL;
5047 GSList *list = get_sorted_cpu_model_list();
5048 g_slist_foreach(list, x86_cpu_definition_entry, &cpu_list);
5049 g_slist_free(list);

--- 2375 unchanged lines hidden ---