aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2021-10-27 09:42:40 -0700
committerRichard Henderson <richard.henderson@linaro.org>2021-10-27 09:42:40 -0700
commit5c49c6c241e524b6ba7768de07cab6f2056feb90 (patch)
tree7b55c4687b9ba2f2c426b106772c14e82761db5a /include
parent931ce30859176f0f7daac6bac255dae5eb21284e (diff)
parentaa2370444b62f8f9a809c024d0c41cb40658a5c3 (diff)
downloadqemu-5c49c6c241e524b6ba7768de07cab6f2056feb90.zip
qemu-5c49c6c241e524b6ba7768de07cab6f2056feb90.tar.gz
qemu-5c49c6c241e524b6ba7768de07cab6f2056feb90.tar.bz2
Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2021-10-27' into staging
QAPI patches patches for 2021-10-27 # gpg: Signature made Wed 27 Oct 2021 08:21:54 AM PDT # gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653 # gpg: issuer "armbru@redhat.com" # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full] # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [full] * remotes/armbru/tags/pull-qapi-2021-10-27: qapi: Implement deprecated-input={reject,crash} for enum values qapi: Move compat policy from QObject to generic visitor qapi: Add feature flags to enum members qapi: Enable enum member introspection to show more than name qapi: Improve input_type_enum()'s error message Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/qapi/qobject-input-visitor.h4
-rw-r--r--include/qapi/qobject-output-visitor.h4
-rw-r--r--include/qapi/util.h6
-rw-r--r--include/qapi/visitor-impl.h3
-rw-r--r--include/qapi/visitor.h9
5 files changed, 17 insertions, 9 deletions
diff --git a/include/qapi/qobject-input-visitor.h b/include/qapi/qobject-input-visitor.h
index 8d69388..95985e2 100644
--- a/include/qapi/qobject-input-visitor.h
+++ b/include/qapi/qobject-input-visitor.h
@@ -15,7 +15,6 @@
#ifndef QOBJECT_INPUT_VISITOR_H
#define QOBJECT_INPUT_VISITOR_H
-#include "qapi/qapi-types-compat.h"
#include "qapi/visitor.h"
typedef struct QObjectInputVisitor QObjectInputVisitor;
@@ -59,9 +58,6 @@ 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/qobject-output-visitor.h b/include/qapi/qobject-output-visitor.h
index f2a2f92..2b1726b 100644
--- a/include/qapi/qobject-output-visitor.h
+++ b/include/qapi/qobject-output-visitor.h
@@ -15,7 +15,6 @@
#define QOBJECT_OUTPUT_VISITOR_H
#include "qapi/visitor.h"
-#include "qapi/qapi-types-compat.h"
typedef struct QObjectOutputVisitor QObjectOutputVisitor;
@@ -54,7 +53,4 @@ 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/util.h b/include/qapi/util.h
index d7bfb30..257c600 100644
--- a/include/qapi/util.h
+++ b/include/qapi/util.h
@@ -11,9 +11,13 @@
#ifndef QAPI_UTIL_H
#define QAPI_UTIL_H
+/* QEnumLookup flags */
+#define QAPI_ENUM_DEPRECATED 1
+
typedef struct QEnumLookup {
const char *const *array;
- int size;
+ const unsigned char *const flags;
+ const int size;
} QEnumLookup;
const char *qapi_enum_lookup(const QEnumLookup *lookup, int val);
diff --git a/include/qapi/visitor-impl.h b/include/qapi/visitor-impl.h
index 3b950f6..72b6537 100644
--- a/include/qapi/visitor-impl.h
+++ b/include/qapi/visitor-impl.h
@@ -122,6 +122,9 @@ struct Visitor
/* Must be set */
VisitorType type;
+ /* Optional */
+ struct CompatPolicy compat_policy;
+
/* Must be set for output visitors, optional otherwise. */
void (*complete)(Visitor *v, void *opaque);
diff --git a/include/qapi/visitor.h b/include/qapi/visitor.h
index b3c9ef7..dcb9601 100644
--- a/include/qapi/visitor.h
+++ b/include/qapi/visitor.h
@@ -16,6 +16,7 @@
#define QAPI_VISITOR_H
#include "qapi/qapi-builtin-types.h"
+#include "qapi/qapi-types-compat.h"
/*
* The QAPI schema defines both a set of C data types, and a QMP wire
@@ -478,6 +479,14 @@ bool visit_deprecated_accept(Visitor *v, const char *name, Error **errp);
bool visit_deprecated(Visitor *v, const char *name);
/*
+ * Set policy for handling deprecated management interfaces.
+ *
+ * Intended use: call visit_set_policy(v, &compat_policy) when
+ * visiting management interface input or output.
+ */
+void visit_set_policy(Visitor *v, CompatPolicy *policy);
+
+/*
* Visit an enum value.
*
* @name expresses the relationship of this enum to its parent