diff options
author | Markus Armbruster <armbru@redhat.com> | 2021-10-25 06:24:03 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2021-10-27 17:19:15 +0200 |
commit | ed29bb28f8b0b17e965efcc2535fc32e101e3ceb (patch) | |
tree | 1bfd2967f141c4d71fc7bb08f71481b25cc1d6b9 /qapi/qapi-visit-core.c | |
parent | b6c18755e41f7b40aad4c2c8188fb1719535699d (diff) |
qapi: Move compat policy from QObject to generic visitor
The next commit needs to access compat policy from the generic visitor
core. Move it there from qobject input and output visitor.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20211025042405.3762351-4-armbru@redhat.com>
Diffstat (limited to 'qapi/qapi-visit-core.c')
-rw-r--r-- | qapi/qapi-visit-core.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c index 7310f0a0ca..93fb154ef3 100644 --- a/qapi/qapi-visit-core.c +++ b/qapi/qapi-visit-core.c @@ -19,6 +19,10 @@ #include "qapi/visitor-impl.h" #include "trace.h" +/* Zero-initialization must result in default policy */ +QEMU_BUILD_BUG_ON(COMPAT_POLICY_INPUT_ACCEPT || COMPAT_POLICY_OUTPUT_ACCEPT); + + void visit_complete(Visitor *v, void *opaque) { assert(v->type != VISITOR_OUTPUT || v->complete); @@ -153,6 +157,11 @@ bool visit_deprecated(Visitor *v, const char *name) return true; } +void visit_set_policy(Visitor *v, CompatPolicy *policy) +{ + v->compat_policy = *policy; +} + bool visit_is_input(Visitor *v) { return v->type == VISITOR_INPUT; |