cpu_models.c (879860ca706fa1ef47ba511c49a6e2b1b49be9b7) | cpu_models.c (54aa3de72ea2aaa2e903e7e879a4f3dda515a00e) |
---|---|
1/* 2 * CPU models for s390x 3 * 4 * Copyright 2016 IBM Corp. 5 * 6 * Author(s): David Hildenbrand <dahi@linux.vnet.ibm.com> 7 * 8 * This work is licensed under the terms of the GNU GPL, version 2 or (at --- 413 unchanged lines hidden (view full) --- 422 CpuDefinitionInfoList *list; 423 S390CPUModel *model; 424}; 425 426static void create_cpu_model_list(ObjectClass *klass, void *opaque) 427{ 428 struct CpuDefinitionInfoListData *cpu_list_data = opaque; 429 CpuDefinitionInfoList **cpu_list = &cpu_list_data->list; | 1/* 2 * CPU models for s390x 3 * 4 * Copyright 2016 IBM Corp. 5 * 6 * Author(s): David Hildenbrand <dahi@linux.vnet.ibm.com> 7 * 8 * This work is licensed under the terms of the GNU GPL, version 2 or (at --- 413 unchanged lines hidden (view full) --- 422 CpuDefinitionInfoList *list; 423 S390CPUModel *model; 424}; 425 426static void create_cpu_model_list(ObjectClass *klass, void *opaque) 427{ 428 struct CpuDefinitionInfoListData *cpu_list_data = opaque; 429 CpuDefinitionInfoList **cpu_list = &cpu_list_data->list; |
430 CpuDefinitionInfoList *entry; | |
431 CpuDefinitionInfo *info; 432 char *name = g_strdup(object_class_get_name(klass)); 433 S390CPUClass *scc = S390_CPU_CLASS(klass); 434 435 /* strip off the -s390x-cpu */ 436 g_strrstr(name, "-" TYPE_S390_CPU)[0] = 0; 437 info = g_new0(CpuDefinitionInfo, 1); 438 info->name = name; --- 10 unchanged lines hidden (view full) --- 449 if (sc->model) { 450 info->has_unavailable_features = true; 451 check_unavailable_features(cpu_list_data->model, sc->model, 452 &info->unavailable_features); 453 } 454 object_unref(obj); 455 } 456 | 430 CpuDefinitionInfo *info; 431 char *name = g_strdup(object_class_get_name(klass)); 432 S390CPUClass *scc = S390_CPU_CLASS(klass); 433 434 /* strip off the -s390x-cpu */ 435 g_strrstr(name, "-" TYPE_S390_CPU)[0] = 0; 436 info = g_new0(CpuDefinitionInfo, 1); 437 info->name = name; --- 10 unchanged lines hidden (view full) --- 448 if (sc->model) { 449 info->has_unavailable_features = true; 450 check_unavailable_features(cpu_list_data->model, sc->model, 451 &info->unavailable_features); 452 } 453 object_unref(obj); 454 } 455 |
457 entry = g_new0(CpuDefinitionInfoList, 1); 458 entry->value = info; 459 entry->next = *cpu_list; 460 *cpu_list = entry; | 456 QAPI_LIST_PREPEND(*cpu_list, info); |
461} 462 463CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp) 464{ 465 struct CpuDefinitionInfoListData list_data = { 466 .list = NULL, 467 }; 468 --- 150 unchanged lines hidden (view full) --- 619 expansion_info->model = g_malloc0(sizeof(*expansion_info->model)); 620 cpu_info_from_model(expansion_info->model, &s390_model, delta_changes); 621 return expansion_info; 622} 623 624static void list_add_feat(const char *name, void *opaque) 625{ 626 strList **last = (strList **) opaque; | 457} 458 459CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp) 460{ 461 struct CpuDefinitionInfoListData list_data = { 462 .list = NULL, 463 }; 464 --- 150 unchanged lines hidden (view full) --- 615 expansion_info->model = g_malloc0(sizeof(*expansion_info->model)); 616 cpu_info_from_model(expansion_info->model, &s390_model, delta_changes); 617 return expansion_info; 618} 619 620static void list_add_feat(const char *name, void *opaque) 621{ 622 strList **last = (strList **) opaque; |
627 strList *entry; | |
628 | 623 |
629 entry = g_new0(strList, 1); 630 entry->value = g_strdup(name); 631 entry->next = *last; 632 *last = entry; | 624 QAPI_LIST_PREPEND(*last, g_strdup(name)); |
633} 634 635CpuModelCompareInfo *qmp_query_cpu_model_comparison(CpuModelInfo *infoa, 636 CpuModelInfo *infob, 637 Error **errp) 638{ 639 Error *err = NULL; 640 CpuModelCompareResult feat_result, gen_result; --- 767 unchanged lines hidden --- | 625} 626 627CpuModelCompareInfo *qmp_query_cpu_model_comparison(CpuModelInfo *infoa, 628 CpuModelInfo *infob, 629 Error **errp) 630{ 631 Error *err = NULL; 632 CpuModelCompareResult feat_result, gen_result; --- 767 unchanged lines hidden --- |