mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 23:25:48 +00:00
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>
This commit is contained in:
@ -14,7 +14,6 @@
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include <math.h>
|
||||
#include "qapi/compat-policy.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qobject-input-visitor.h"
|
||||
#include "qapi/visitor-impl.h"
|
||||
@ -44,7 +43,6 @@ typedef struct StackObject {
|
||||
|
||||
struct QObjectInputVisitor {
|
||||
Visitor visitor;
|
||||
CompatPolicyInput deprecated_policy;
|
||||
|
||||
/* Root of visit at visitor creation. */
|
||||
QObject *root;
|
||||
@ -667,9 +665,7 @@ static void qobject_input_optional(Visitor *v, const char *name, bool *present)
|
||||
static bool qobject_input_deprecated_accept(Visitor *v, const char *name,
|
||||
Error **errp)
|
||||
{
|
||||
QObjectInputVisitor *qiv = to_qiv(v);
|
||||
|
||||
switch (qiv->deprecated_policy) {
|
||||
switch (v->compat_policy.deprecated_input) {
|
||||
case COMPAT_POLICY_INPUT_ACCEPT:
|
||||
return true;
|
||||
case COMPAT_POLICY_INPUT_REJECT:
|
||||
@ -739,14 +735,6 @@ Visitor *qobject_input_visitor_new(QObject *obj)
|
||||
return &v->visitor;
|
||||
}
|
||||
|
||||
void qobject_input_visitor_set_policy(Visitor *v,
|
||||
CompatPolicyInput deprecated)
|
||||
{
|
||||
QObjectInputVisitor *qiv = to_qiv(v);
|
||||
|
||||
qiv->deprecated_policy = deprecated;
|
||||
}
|
||||
|
||||
Visitor *qobject_input_visitor_new_keyval(QObject *obj)
|
||||
{
|
||||
QObjectInputVisitor *v = qobject_input_visitor_base_new(obj);
|
||||
|
Reference in New Issue
Block a user