aboutsummaryrefslogtreecommitdiff
path: root/monitor/qmp-cmds-control.c
diff options
context:
space:
mode:
Diffstat (limited to 'monitor/qmp-cmds-control.c')
-rw-r--r--monitor/qmp-cmds-control.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/monitor/qmp-cmds-control.c b/monitor/qmp-cmds-control.c
index 17514f4959..509ae870bd 100644
--- a/monitor/qmp-cmds-control.c
+++ b/monitor/qmp-cmds-control.c
@@ -104,17 +104,16 @@ VersionInfo *qmp_query_version(Error **errp)
static void query_commands_cb(const QmpCommand *cmd, void *opaque)
{
- CommandInfoList *info, **list = opaque;
+ CommandInfo *info;
+ CommandInfoList **list = opaque;
if (!cmd->enabled) {
return;
}
info = g_malloc0(sizeof(*info));
- info->value = g_malloc0(sizeof(*info->value));
- info->value->name = g_strdup(cmd->name);
- info->next = *list;
- *list = info;
+ info->name = g_strdup(cmd->name);
+ QAPI_LIST_PREPEND(*list, info);
}
CommandInfoList *qmp_query_commands(Error **errp)