diff options
Diffstat (limited to 'include/qapi')
| -rw-r--r-- | include/qapi/compat-policy.h | 9 | ||||
| -rw-r--r-- | include/qapi/qobject-input-visitor.h | 4 | ||||
| -rw-r--r-- | include/qapi/visitor-impl.h | 3 | ||||
| -rw-r--r-- | include/qapi/visitor.h | 9 |
4 files changed, 25 insertions, 0 deletions
diff --git a/include/qapi/compat-policy.h b/include/qapi/compat-policy.h index 94c8bbd790..1083f95122 100644 --- a/include/qapi/compat-policy.h +++ b/include/qapi/compat-policy.h @@ -18,6 +18,15 @@ extern CompatPolicy compat_policy; /* + * Create a QObject input visitor for @obj for use with QMP + * + * This is like qobject_input_visitor_new(), except it obeys the + * policy for handling deprecated management interfaces set with + * -compat. + */ +Visitor *qobject_input_visitor_new_qmp(QObject *obj); + +/* * Create a QObject output visitor for @obj for use with QMP * * This is like qobject_output_visitor_new(), except it obeys the diff --git a/include/qapi/qobject-input-visitor.h b/include/qapi/qobject-input-visitor.h index 95985e25e5..8d69388810 100644 --- a/include/qapi/qobject-input-visitor.h +++ b/include/qapi/qobject-input-visitor.h @@ -15,6 +15,7 @@ #ifndef QOBJECT_INPUT_VISITOR_H #define QOBJECT_INPUT_VISITOR_H +#include "qapi/qapi-types-compat.h" #include "qapi/visitor.h" typedef struct QObjectInputVisitor QObjectInputVisitor; @@ -58,6 +59,9 @@ typedef struct QObjectInputVisitor QObjectInputVisitor; */ Visitor *qobject_input_visitor_new(QObject *obj); +void qobject_input_visitor_set_policy(Visitor *v, + CompatPolicyInput deprecated); + /* * Create a QObject input visitor for @obj for use with keyval_parse() * diff --git a/include/qapi/visitor-impl.h b/include/qapi/visitor-impl.h index 2d853255a3..3b950f6e3d 100644 --- a/include/qapi/visitor-impl.h +++ b/include/qapi/visitor-impl.h @@ -114,6 +114,9 @@ struct Visitor void (*optional)(Visitor *v, const char *name, bool *present); /* Optional */ + bool (*deprecated_accept)(Visitor *v, const char *name, Error **errp); + + /* Optional */ bool (*deprecated)(Visitor *v, const char *name); /* Must be set */ diff --git a/include/qapi/visitor.h b/include/qapi/visitor.h index 4d23b59853..b3c9ef7a81 100644 --- a/include/qapi/visitor.h +++ b/include/qapi/visitor.h @@ -460,6 +460,15 @@ void visit_end_alternate(Visitor *v, void **obj); bool visit_optional(Visitor *v, const char *name, bool *present); /* + * Should we reject deprecated member @name? + * + * @name must not be NULL. This function is only useful between + * visit_start_struct() and visit_end_struct(), since only objects + * have deprecated members. + */ +bool visit_deprecated_accept(Visitor *v, const char *name, Error **errp); + +/* * Should we visit deprecated member @name? * * @name must not be NULL. This function is only useful between |