qapi: Improve specificity of type/member descriptions
[qemu/armbru.git] / target / mips / sysemu / mips-qmp-cmds.c
blob6db4626412cf84d4973c4fc607214572d34ad55d
1 /*
2 * QEMU MIPS CPU (monitor definitions)
4 * SPDX-FileCopyrightText: 2012 SUSE LINUX Products GmbH
6 * SPDX-License-Identifier: LGPL-2.1-or-later
7 */
9 #include "qemu/osdep.h"
10 #include "qapi/qapi-commands-machine-target.h"
11 #include "cpu.h"
13 static void mips_cpu_add_definition(gpointer data, gpointer user_data)
15 ObjectClass *oc = data;
16 CpuDefinitionInfoList **cpu_list = user_data;
17 CpuDefinitionInfo *info;
18 const char *typename;
20 typename = object_class_get_name(oc);
21 info = g_malloc0(sizeof(*info));
22 info->name = g_strndup(typename,
23 strlen(typename) - strlen("-" TYPE_MIPS_CPU));
24 info->q_typename = g_strdup(typename);
26 QAPI_LIST_PREPEND(*cpu_list, info);
29 CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp)
31 CpuDefinitionInfoList *cpu_list = NULL;
32 GSList *list;
34 list = object_class_get_list(TYPE_MIPS_CPU, false);
35 g_slist_foreach(list, mips_cpu_add_definition, &cpu_list);
36 g_slist_free(list);
38 return cpu_list;