Commit 0eee31cf108 (qapi/qom: add qapi-type to qom-list,
qom-list-properties, qom-list-get) had to make @qapi-type optional to
enable incremental conversion to QAPI-aware property registration.
This conversion is now complete: @qapi-type is always present.  Make
it mandatory.

Signed-off-by: Markus Armbruster <[email protected]>
Reviewed-by: Marc-AndrĂ© Lureau <[email protected]>
---
 qapi/qom.json              | 10 ++++------
 tests/qtest/qmp-cmd-test.c |  9 +--------
 2 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/qapi/qom.json b/qapi/qom.json
index 32a59269361..cc642c7ba97 100644
--- a/qapi/qom.json
+++ b/qapi/qom.json
@@ -36,8 +36,7 @@
 #        graph.
 #
 # @qapi-type: the name of the property's type as it appears in the
-#     output of ``query-qmp-schema``.  Absent if the type does not
-#     occur there.  (since 11.2)
+#     output of ``query-qmp-schema``.  (since 11.2)
 #
 # @description: if specified, the description of the property.
 #
@@ -52,7 +51,7 @@
 { 'struct': 'ObjectPropertyInfo',
   'data': { 'name': 'str',
             'type': 'str',
-            '*qapi-type': { 'type': 'str', 'features': [ 'unstable' ] },
+            'qapi-type': { 'type': 'str', 'features': [ 'unstable' ] },
             '*description': 'str',
             '*default-value': 'any' } }
 
@@ -65,8 +64,7 @@
 #     `ObjectPropertyInfo`.
 #
 # @qapi-type: the name of the property's type as it appears in the
-#     output of ``query-qmp-schema``.  Absent if the type does not
-#     occur there.  (since 11.2)
+#     output of ``query-qmp-schema``.  (since 11.2)
 #
 # @value: the value of the property.  Absent when the property cannot
 #     be read.
@@ -80,7 +78,7 @@
 { 'struct': 'ObjectPropertyValue',
   'data': { 'name': 'str',
             'type': 'str',
-            '*qapi-type': { 'type': 'str', 'features': [ 'unstable' ] },
+            'qapi-type': { 'type': 'str', 'features': [ 'unstable' ] },
             '*value': 'any' } }
 
 ##
diff --git a/tests/qtest/qmp-cmd-test.c b/tests/qtest/qmp-cmd-test.c
index 5138582bb3f..c93120a194c 100644
--- a/tests/qtest/qmp-cmd-test.c
+++ b/tests/qtest/qmp-cmd-test.c
@@ -379,15 +379,8 @@ static void test_qapi_type(void)
         QLIST_FOREACH_ENTRY(props, prop_entry) {
             QDict *prop = qobject_to(QDict, qlist_entry_obj(prop_entry));
             const char *qapi_type = qdict_get_try_str(prop, "qapi-type");
-            const char *propname = qdict_get_str(prop, "name");
-            const char *ty = qdict_get_str(prop, "type");
 
-            if (qapi_type) {
-                g_assert_nonnull(qmp_schema_lookup(&schema, qapi_type));
-            } else {
-                g_test_message("%s.%s %s has no associated qapi-type",
-                               name, propname, ty);
-            }
+            g_assert_nonnull(qmp_schema_lookup(&schema, qapi_type));
         }
     }
     qtest_quit(qts);
-- 
2.55.0


Reply via email to