migration/rdma: Silence qemu_rdma_register_and_get_keys()
[qemu/kevin.git] / target / loongarch / loongarch-qmp-cmds.c
blob6c25957881420bee016b78fe14fdfa6c5ee8e550
1 /*
2 * QEMU LoongArch CPU (monitor definitions)
4 * SPDX-FileCopyrightText: 2021 Loongson Technology Corporation Limited
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
9 #include "qemu/osdep.h"
10 #include "qapi/qapi-commands-machine-target.h"
11 #include "cpu.h"
13 static void loongarch_cpu_add_definition(gpointer data, gpointer user_data)
15 ObjectClass *oc = data;
16 CpuDefinitionInfoList **cpu_list = user_data;
17 CpuDefinitionInfo *info = g_new0(CpuDefinitionInfo, 1);
18 const char *typename = object_class_get_name(oc);
20 info->name = g_strndup(typename,
21 strlen(typename) - strlen("-" TYPE_LOONGARCH_CPU));
22 info->q_typename = g_strdup(typename);
24 QAPI_LIST_PREPEND(*cpu_list, info);
27 CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp)
29 CpuDefinitionInfoList *cpu_list = NULL;
30 GSList *list;
32 list = object_class_get_list(TYPE_LOONGARCH_CPU, false);
33 g_slist_foreach(list, loongarch_cpu_add_definition, &cpu_list);
34 g_slist_free(list);
36 return cpu_list;