aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi-event.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/qapi-event.py')
-rw-r--r--scripts/qapi-event.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py
index 21fb167..9c88627 100644
--- a/scripts/qapi-event.py
+++ b/scripts/qapi-event.py
@@ -71,7 +71,7 @@ def gen_event_send(name, arg_type):
if arg_type and arg_type.members:
ret += mcgen('''
- QmpOutputVisitor *qov;
+ QObject *obj;
Visitor *v;
''')
ret += gen_param_var(arg_type)
@@ -90,8 +90,7 @@ def gen_event_send(name, arg_type):
if arg_type and arg_type.members:
ret += mcgen('''
- qov = qmp_output_visitor_new();
- v = qmp_output_get_visitor(qov);
+ v = qmp_output_visitor_new(&obj);
visit_start_struct(v, "%(name)s", NULL, 0, &err);
if (err) {
@@ -101,12 +100,13 @@ def gen_event_send(name, arg_type):
if (!err) {
visit_check_struct(v, &err);
}
- visit_end_struct(v);
+ visit_end_struct(v, NULL);
if (err) {
goto out;
}
- qdict_put_obj(qmp, "data", qmp_output_get_qobject(qov));
+ visit_complete(v, &obj);
+ qdict_put_obj(qmp, "data", obj);
''',
name=name, c_name=arg_type.c_name())
@@ -119,7 +119,7 @@ def gen_event_send(name, arg_type):
if arg_type and arg_type.members:
ret += mcgen('''
out:
- qmp_output_visitor_cleanup(qov);
+ visit_free(v);
''')
ret += mcgen('''
error_propagate(errp, err);