/src/qemu/build-oss-fuzz/qapi/qapi-visit-replay.c
Line | Count | Source |
1 | | /* AUTOMATICALLY GENERATED by qapi-gen.py DO NOT MODIFY */ |
2 | | |
3 | | /* |
4 | | * Schema-defined QAPI visitors |
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/error.h" |
15 | | #include "qapi-visit-replay.h" |
16 | | #include "qapi-features.h" |
17 | | |
18 | | bool visit_type_ReplayMode(Visitor *v, const char *name, |
19 | | ReplayMode *obj, Error **errp) |
20 | 0 | { |
21 | 0 | int value = *obj; |
22 | 0 | bool ok = visit_type_enum(v, name, &value, &ReplayMode_lookup, errp); |
23 | 0 | *obj = value; |
24 | 0 | return ok; |
25 | 0 | } |
26 | | |
27 | | bool visit_type_ReplayInfo_members(Visitor *v, ReplayInfo *obj, Error **errp) |
28 | 0 | { |
29 | 0 | bool has_filename = !!obj->filename; |
30 | |
|
31 | 0 | if (!visit_type_ReplayMode(v, "mode", &obj->mode, errp)) { |
32 | 0 | return false; |
33 | 0 | } |
34 | 0 | if (visit_optional(v, "filename", &has_filename)) { |
35 | 0 | if (!visit_type_str(v, "filename", &obj->filename, errp)) { |
36 | 0 | return false; |
37 | 0 | } |
38 | 0 | } |
39 | 0 | if (!visit_type_int(v, "icount", &obj->icount, errp)) { |
40 | 0 | return false; |
41 | 0 | } |
42 | 0 | return true; |
43 | 0 | } |
44 | | |
45 | | bool visit_type_ReplayInfo(Visitor *v, const char *name, |
46 | | ReplayInfo **obj, Error **errp) |
47 | 0 | { |
48 | 0 | bool ok = false; |
49 | |
|
50 | 0 | if (!visit_start_struct(v, name, (void **)obj, sizeof(ReplayInfo), errp)) { |
51 | 0 | return false; |
52 | 0 | } |
53 | 0 | if (!*obj) { |
54 | | /* incomplete */ |
55 | 0 | assert(visit_is_dealloc(v)); |
56 | 0 | ok = true; |
57 | 0 | goto out_obj; |
58 | 0 | } |
59 | 0 | if (!visit_type_ReplayInfo_members(v, *obj, errp)) { |
60 | 0 | goto out_obj; |
61 | 0 | } |
62 | 0 | ok = visit_check_struct(v, errp); |
63 | 0 | out_obj: |
64 | 0 | visit_end_struct(v, (void **)obj); |
65 | 0 | if (!ok && visit_is_input(v)) { |
66 | 0 | qapi_free_ReplayInfo(*obj); |
67 | 0 | *obj = NULL; |
68 | 0 | } |
69 | 0 | return ok; |
70 | 0 | } |
71 | | |
72 | | bool visit_type_q_obj_replay_break_arg_members(Visitor *v, q_obj_replay_break_arg *obj, Error **errp) |
73 | 0 | { |
74 | 0 | if (!visit_type_int(v, "icount", &obj->icount, errp)) { |
75 | 0 | return false; |
76 | 0 | } |
77 | 0 | return true; |
78 | 0 | } |
79 | | |
80 | | bool visit_type_q_obj_replay_seek_arg_members(Visitor *v, q_obj_replay_seek_arg *obj, Error **errp) |
81 | 0 | { |
82 | 0 | if (!visit_type_int(v, "icount", &obj->icount, errp)) { |
83 | 0 | return false; |
84 | 0 | } |
85 | 0 | return true; |
86 | 0 | } |
87 | | |
88 | | /* Dummy declaration to prevent empty .o file */ |
89 | | char qapi_dummy_qapi_visit_replay_c; |