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-yank.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-yank.h"
20
#include "qapi-commands-yank.h"
21
#include "qobject/qjson.h"
22
#include "trace/trace-qapi_commands_yank_trace_events.h"
23
24
void qmp_marshal_yank(QDict *args, QObject **ret, Error **errp)
25
0
{
26
0
    Error *err = NULL;
27
0
    bool ok = false;
28
0
    Visitor *v;
29
0
    q_obj_yank_arg arg = {0};
30
31
0
    v = qobject_input_visitor_new_qmp(QOBJECT(args));
32
0
    if (!visit_start_struct(v, NULL, NULL, 0, errp)) {
33
0
        goto out;
34
0
    }
35
0
    if (visit_type_q_obj_yank_arg_members(v, &arg, errp)) {
36
0
        ok = visit_check_struct(v, errp);
37
0
    }
38
0
    visit_end_struct(v, NULL);
39
0
    if (!ok) {
40
0
        goto out;
41
0
    }
42
43
0
    if (trace_event_get_state_backends(TRACE_QMP_ENTER_YANK)) {
44
0
        g_autoptr(GString) req_json = qobject_to_json(QOBJECT(args));
45
46
0
        trace_qmp_enter_yank(req_json->str);
47
0
    }
48
49
0
    qmp_yank(arg.instances, &err);
50
0
    if (err) {
51
0
        trace_qmp_exit_yank(error_get_pretty(err), false);
52
0
        error_propagate(errp, err);
53
0
        goto out;
54
0
    }
55
56
0
    trace_qmp_exit_yank("{}", true);
57
58
0
out:
59
0
    visit_free(v);
60
0
    v = qapi_dealloc_visitor_new();
61
0
    visit_start_struct(v, NULL, NULL, 0, NULL);
62
0
    visit_type_q_obj_yank_arg_members(v, &arg, NULL);
63
0
    visit_end_struct(v, NULL);
64
0
    visit_free(v);
65
0
}
66
67
void qmp_marshal_query_yank(QDict *args, QObject **ret, Error **errp)
68
0
{
69
0
    Error *err = NULL;
70
0
    bool ok = false;
71
0
    Visitor *v;
72
0
    YankInstanceList *retval;
73
0
    Visitor *ov;
74
75
0
    v = qobject_input_visitor_new_qmp(QOBJECT(args));
76
0
    if (!visit_start_struct(v, NULL, NULL, 0, errp)) {
77
0
        goto out;
78
0
    }
79
0
    ok = visit_check_struct(v, errp);
80
0
    visit_end_struct(v, NULL);
81
0
    if (!ok) {
82
0
        goto out;
83
0
    }
84
85
0
    if (trace_event_get_state_backends(TRACE_QMP_ENTER_QUERY_YANK)) {
86
0
        g_autoptr(GString) req_json = qobject_to_json(QOBJECT(args));
87
88
0
        trace_qmp_enter_query_yank(req_json->str);
89
0
    }
90
91
0
    retval = qmp_query_yank(&err);
92
0
    if (err) {
93
0
        trace_qmp_exit_query_yank(error_get_pretty(err), false);
94
0
        error_propagate(errp, err);
95
0
        goto out;
96
0
    }
97
98
0
    ov = qobject_output_visitor_new_qmp(ret);
99
0
    if (visit_type_YankInstanceList(ov, "unused", &retval, errp)) {
100
0
        visit_complete(ov, ret);
101
0
    }
102
0
    visit_free(ov);
103
0
    ov = qapi_dealloc_visitor_new();
104
0
    visit_type_YankInstanceList(ov, "unused", &retval, NULL);
105
0
    visit_free(ov);
106
107
0
    if (trace_event_get_state_backends(TRACE_QMP_EXIT_QUERY_YANK)) {
108
0
        g_autoptr(GString) ret_json = qobject_to_json(*ret);
109
110
0
        trace_qmp_exit_query_yank(ret_json->str, true);
111
0
    }
112
113
0
out:
114
0
    visit_free(v);
115
0
    v = qapi_dealloc_visitor_new();
116
0
    visit_start_struct(v, NULL, NULL, 0, NULL);
117
    visit_end_struct(v, NULL);
118
0
    visit_free(v);
119
0
}
120
121
/* Dummy declaration to prevent empty .o file */
122
char qapi_dummy_qapi_commands_yank_c;