aboutsummaryrefslogtreecommitdiff
path: root/monitor/qmp-cmds-control.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2021-01-13 16:10:10 -0600
committerMarkus Armbruster <armbru@redhat.com>2021-01-28 08:08:45 +0100
commit240ee8bd31f7ff7407197588ae800ff554758b4d (patch)
treea5025106cb2effe7fcb6cdf6d05040527c1d4118 /monitor/qmp-cmds-control.c
parente9d635ea1809a6e114c33413c359abbb88a35737 (diff)
qapi: A couple more QAPI_LIST_PREPEND() stragglers
Commit 54aa3de72e switched multiple sites to use QAPI_LIST_PREPEND instead of open-coding, but missed a couple of spots. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20210113221013.390592-3-eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
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)