From: Marc-André Lureau <[email protected]>

Introduce a minimal struct that pairs a QAPI type's internal name with
its "masked" introspection name. Generated constants of this type will
let QOM property registration carry a reliable reference to the QAPI
schema and possibly other associated data.

The fields are populated in following commits.

Signed-off-by: Marc-André Lureau <[email protected]>
Signed-off-by: Markus Armbruster <[email protected]>
---
 include/qapi/qapi-type-info.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
 create mode 100644 include/qapi/qapi-type-info.h

diff --git a/include/qapi/qapi-type-info.h b/include/qapi/qapi-type-info.h
new file mode 100644
index 0000000000..a14ba56016
--- /dev/null
+++ b/include/qapi/qapi-type-info.h
@@ -0,0 +1,25 @@
+/*
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef QAPI_TYPE_INFO_H
+#define QAPI_TYPE_INFO_H
+
+#include "qapi/util.h"
+
+/**
+ * QAPITypeInfo - QAPI type metadata
+ *
+ * @name: QAPI type name (e.g. "str", "OnOffAuto", "int32List").
+ *        QOM uses this as the property type string.
+ * @masked_name: Name of the type in the output of query-qmp-schema,
+ *        assigned by scripts/qapi code generator (e.g. "368").
+ * @lookup: QEnumLookup for this type, or NULL for non-enum types.
+ */
+typedef struct QAPITypeInfo {
+    const char *name;
+    const char *masked_name;
+    const QEnumLookup *lookup;
+} QAPITypeInfo;
+
+#endif /* QAPI_TYPE_INFO_H */
-- 
2.55.0


Reply via email to