From 240ee8bd31f7ff7407197588ae800ff554758b4d Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 13 Jan 2021 16:10:10 -0600 Subject: 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 Message-Id: <20210113221013.390592-3-eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy Signed-off-by: Markus Armbruster --- monitor/qmp-cmds-control.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'monitor') diff --git a/monitor/qmp-cmds-control.c b/monitor/qmp-cmds-control.c index 17514f4..509ae87 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) -- cgit v1.1