Coverage Report

Created: 2026-11-20 08:13

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/qemu/build-oss-fuzz/qapi/qapi-commands-replay.c
Line
Count
Source
1
/* AUTOMATICALLY GENERATED by qapi-gen.py DO NOT MODIFY */
2
3
/*
4
 * Schema-defined QAPI/QMP commands
5
 *
6
 * Copyright IBM, Corp. 2011
7
 * Copyright (C) 2014-2018 Red Hat, Inc.
8
 *
9
 * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
10
 * See the COPYING.LIB file in the top-level directory.
11
 */
12
13
#include "qemu/osdep.h"
14
#include "qapi/compat-policy.h"
15
#include "qapi/visitor.h"
16
#include "qobject/qdict.h"
17
#include "qapi/dealloc-visitor.h"
18
#include "qapi/error.h"
19
#include "qapi-visit-replay.h"
20
#include "qapi-commands-replay.h"
21
#include "qobject/qjson.h"
22
#include "trace/trace-qapi_commands_replay_trace_events.h"
23
24
void qmp_marshal_query_replay(QDict *args, QObject **ret, Error **errp)
25
0
{
26
0
    Error *err = NULL;
27
0
    bool ok = false;
28
0
    Visitor *v;
29
0
    ReplayInfo *retval;
30
0
    Visitor *ov;
31
32
0
    v = qobject_input_visitor_new_qmp(QOBJECT(args));
33
0
    if (!visit_start_struct(v, NULL, NULL, 0, errp)) {
34
0
        goto out;
35
0
    }
36
0
    ok = visit_check_struct(v, errp);
37
0
    visit_end_struct(v, NULL);
38
0
    if (!ok) {
39
0
        goto out;
40
0
    }
41
42
0
    if (trace_event_get_state_backends(TRACE_QMP_ENTER_QUERY_REPLAY)) {
43
0
        g_autoptr(GString) req_json = qobject_to_json(QOBJECT(args));
44
45
0
        trace_qmp_enter_query_replay(req_json->str);
46
0
    }
47
48
0
    retval = qmp_query_replay(&err);
49
0
    if (err) {
50
0
        trace_qmp_exit_query_replay(error_get_pretty(err), false);
51
0
        error_propagate(errp, err);
52
0
        goto out;
53
0
    }
54
55
0
    ov = qobject_output_visitor_new_qmp(ret);
56
0
    if (visit_type_ReplayInfo(ov, "unused", &retval, errp)) {
57
0
        visit_complete(ov, ret);
58
0
    }
59
0
    visit_free(ov);
60
0
    ov = qapi_dealloc_visitor_new();
61
0
    visit_type_ReplayInfo(ov, "unused", &retval, NULL);
62
0
    visit_free(ov);
63
64
0
    if (trace_event_get_state_backends(TRACE_QMP_EXIT_QUERY_REPLAY)) {
65
0
        g_autoptr(GString) ret_json = qobject_to_json(*ret);
66
67
0
        trace_qmp_exit_query_replay(ret_json->str, true);
68
0
    }
69
70
0
out:
71
0
    visit_free(v);
72
0
    v = qapi_dealloc_visitor_new();
73
0
    visit_start_struct(v, NULL, NULL, 0, NULL);
74
0
    visit_end_struct(v, NULL);
75
0
    visit_free(v);
76
0
}
77
78
void qmp_marshal_replay_break(QDict *args, QObject **ret, Error **errp)
79
0
{
80
0
    Error *err = NULL;
81
0
    bool ok = false;
82
0
    Visitor *v;
83
0
    q_obj_replay_break_arg arg = {0};
84
85
0
    v = qobject_input_visitor_new_qmp(QOBJECT(args));
86
0
    if (!visit_start_struct(v, NULL, NULL, 0, errp)) {
87
0
        goto out;
88
0
    }
89
0
    if (visit_type_q_obj_replay_break_arg_members(v, &arg, errp)) {
90
0
        ok = visit_check_struct(v, errp);
91
0
    }
92
0
    visit_end_struct(v, NULL);
93
0
    if (!ok) {
94
0
        goto out;
95
0
    }
96
97
0
    if (trace_event_get_state_backends(TRACE_QMP_ENTER_REPLAY_BREAK)) {
98
0
        g_autoptr(GString) req_json = qobject_to_json(QOBJECT(args));
99
100
0
        trace_qmp_enter_replay_break(req_json->str);
101
0
    }
102
103
0
    qmp_replay_break(arg.icount, &err);
104
0
    if (err) {
105
0
        trace_qmp_exit_replay_break(error_get_pretty(err), false);
106
0
        error_propagate(errp, err);
107
0
        goto out;
108
0
    }
109
110
0
    trace_qmp_exit_replay_break("{}", true);
111
112
0
out:
113
0
    visit_free(v);
114
0
    v = qapi_dealloc_visitor_new();
115
0
    visit_start_struct(v, NULL, NULL, 0, NULL);
116
0
    visit_type_q_obj_replay_break_arg_members(v, &arg, NULL);
117
0
    visit_end_struct(v, NULL);
118
0
    visit_free(v);
119
0
}
120
121
void qmp_marshal_replay_delete_break(QDict *args, QObject **ret, Error **errp)
122
0
{
123
0
    Error *err = NULL;
124
0
    bool ok = false;
125
0
    Visitor *v;
126
127
0
    v = qobject_input_visitor_new_qmp(QOBJECT(args));
128
0
    if (!visit_start_struct(v, NULL, NULL, 0, errp)) {
129
0
        goto out;
130
0
    }
131
0
    ok = visit_check_struct(v, errp);
132
0
    visit_end_struct(v, NULL);
133
0
    if (!ok) {
134
0
        goto out;
135
0
    }
136
137
0
    if (trace_event_get_state_backends(TRACE_QMP_ENTER_REPLAY_DELETE_BREAK)) {
138
0
        g_autoptr(GString) req_json = qobject_to_json(QOBJECT(args));
139
140
0
        trace_qmp_enter_replay_delete_break(req_json->str);
141
0
    }
142
143
0
    qmp_replay_delete_break(&err);
144
0
    if (err) {
145
0
        trace_qmp_exit_replay_delete_break(error_get_pretty(err), false);
146
0
        error_propagate(errp, err);
147
0
        goto out;
148
0
    }
149
150
0
    trace_qmp_exit_replay_delete_break("{}", true);
151
152
0
out:
153
0
    visit_free(v);
154
0
    v = qapi_dealloc_visitor_new();
155
0
    visit_start_struct(v, NULL, NULL, 0, NULL);
156
0
    visit_end_struct(v, NULL);
157
0
    visit_free(v);
158
0
}
159
160
void qmp_marshal_replay_seek(QDict *args, QObject **ret, Error **errp)
161
0
{
162
0
    Error *err = NULL;
163
0
    bool ok = false;
164
0
    Visitor *v;
165
0
    q_obj_replay_seek_arg arg = {0};
166
167
0
    v = qobject_input_visitor_new_qmp(QOBJECT(args));
168
0
    if (!visit_start_struct(v, NULL, NULL, 0, errp)) {
169
0
        goto out;
170
0
    }
171
0
    if (visit_type_q_obj_replay_seek_arg_members(v, &arg, errp)) {
172
0
        ok = visit_check_struct(v, errp);
173
0
    }
174
0
    visit_end_struct(v, NULL);
175
0
    if (!ok) {
176
0
        goto out;
177
0
    }
178
179
0
    if (trace_event_get_state_backends(TRACE_QMP_ENTER_REPLAY_SEEK)) {
180
0
        g_autoptr(GString) req_json = qobject_to_json(QOBJECT(args));
181
182
0
        trace_qmp_enter_replay_seek(req_json->str);
183
0
    }
184
185
0
    qmp_replay_seek(arg.icount, &err);
186
0
    if (err) {
187
0
        trace_qmp_exit_replay_seek(error_get_pretty(err), false);
188
0
        error_propagate(errp, err);
189
0
        goto out;
190
0
    }
191
192
0
    trace_qmp_exit_replay_seek("{}", true);
193
194
0
out:
195
0
    visit_free(v);
196
0
    v = qapi_dealloc_visitor_new();
197
0
    visit_start_struct(v, NULL, NULL, 0, NULL);
198
0
    visit_type_q_obj_replay_seek_arg_members(v, &arg, NULL);
199
    visit_end_struct(v, NULL);
200
0
    visit_free(v);
201
0
}
202
203
/* Dummy declaration to prevent empty .o file */
204
char qapi_dummy_qapi_commands_replay_c;