diff options
Diffstat (limited to 'include/qapi')
-rw-r--r-- | include/qapi/compat-policy.h | 9 | ||||
-rw-r--r-- | include/qapi/qobject-output-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 b8c6638156..94c8bbd790 100644 --- a/include/qapi/compat-policy.h +++ b/include/qapi/compat-policy.h @@ -17,4 +17,13 @@ extern CompatPolicy compat_policy; +/* + * Create a QObject output visitor for @obj for use with QMP + * + * This is like qobject_output_visitor_new(), except it obeys the + * policy for handling deprecated management interfaces set with + * -compat. + */ +Visitor *qobject_output_visitor_new_qmp(QObject **result); + #endif diff --git a/include/qapi/qobject-output-visitor.h b/include/qapi/qobject-output-visitor.h index 2b1726baf5..f2a2f92a00 100644 --- a/include/qapi/qobject-output-visitor.h +++ b/include/qapi/qobject-output-visitor.h @@ -15,6 +15,7 @@ #define QOBJECT_OUTPUT_VISITOR_H #include "qapi/visitor.h" +#include "qapi/qapi-types-compat.h" typedef struct QObjectOutputVisitor QObjectOutputVisitor; @@ -53,4 +54,7 @@ typedef struct QObjectOutputVisitor QObjectOutputVisitor; */ Visitor *qobject_output_visitor_new(QObject **result); +void qobject_output_visitor_set_policy(Visitor *v, + CompatPolicyOutput deprecated); + #endif diff --git a/include/qapi/visitor-impl.h b/include/qapi/visitor-impl.h index 7362c043be..2d853255a3 100644 --- a/include/qapi/visitor-impl.h +++ b/include/qapi/visitor-impl.h @@ -113,6 +113,9 @@ struct Visitor The core takes care of the return type in the public interface. */ void (*optional)(Visitor *v, const char *name, bool *present); + /* Optional */ + bool (*deprecated)(Visitor *v, const char *name); + /* Must be set */ VisitorType type; diff --git a/include/qapi/visitor.h b/include/qapi/visitor.h index ebc19ede7f..4d23b59853 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 visit 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(Visitor *v, const char *name); + +/* * Visit an enum value. * * @name expresses the relationship of this enum to its parent |