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.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/monitor/qmp-cmds-control.c b/monitor/qmp-cmds-control.c
index a456762f6a..17514f4959 100644
--- a/monitor/qmp-cmds-control.c
+++ b/monitor/qmp-cmds-control.c
@@ -138,18 +138,18 @@ EventInfoList *qmp_query_events(Error **errp)
* QAPIEvent_str() and QAPIEvent_lookup[]. When the command goes,
* they should go, too.
*/
- EventInfoList *info, *ev_list = NULL;
+ EventInfoList *ev_list = NULL;
QAPIEvent e;
for (e = 0 ; e < QAPI_EVENT__MAX ; e++) {
const char *event_name = QAPIEvent_str(e);
+ EventInfo *info;
+
assert(event_name != NULL);
info = g_malloc0(sizeof(*info));
- info->value = g_malloc0(sizeof(*info->value));
- info->value->name = g_strdup(event_name);
+ info->name = g_strdup(event_name);
- info->next = ev_list;
- ev_list = info;
+ QAPI_LIST_PREPEND(ev_list, info);
}
return ev_list;