Use members @kind and @qom-type instead. Signed-off-by: Markus Armbruster <armbru@redhat.com> --- tests/qtest/device-introspect-test.c | 4 ++-- tests/qtest/qom-test.c | 4 ++-- tests/qtest/readconfig-test.c | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/qtest/device-introspect-test.c b/tests/qtest/device-introspect-test.c index f6eca2c8eb7..60afdbbc9d0 100644 --- a/tests/qtest/device-introspect-test.c +++ b/tests/qtest/device-introspect-test.c @@ -120,8 +120,8 @@ static void qom_tree_walk(QTestState *qts, const char *path, GString *result) QLIST_FOREACH_ENTRY(list, e) { QDict *prop = qobject_to(QDict, qlist_entry_obj(e)); - const char *type = qdict_get_str(prop, "type"); - if (g_str_has_prefix(type, "child<")) { + const char *kind = qdict_get_str(prop, "kind"); + if (!strcmp(kind, "child")) { const char *name = qdict_get_str(prop, "name"); children = g_list_prepend(children, g_strdup(name)); } diff --git a/tests/qtest/qom-test.c b/tests/qtest/qom-test.c index cf4c6b5add5..6f1e9606c5e 100644 --- a/tests/qtest/qom-test.c +++ b/tests/qtest/qom-test.c @@ -148,8 +148,8 @@ static void test_properties(QTestState *qts, const char *path, bool recurse) list = qobject_to(QList, qdict_get(response, "return")); QLIST_FOREACH_ENTRY(list, entry) { tuple = qobject_to(QDict, qlist_entry_obj(entry)); - bool is_child = strstart(qdict_get_str(tuple, "type"), "child<", NULL); - bool is_link = strstart(qdict_get_str(tuple, "type"), "link<", NULL); + bool is_child = !strcmp(qdict_get_str(tuple, "kind"), "child"); + bool is_link = !strcmp(qdict_get_str(tuple, "kind"), "link"); if (is_child || is_link) { child_path = g_strdup_printf("%s/%s", diff --git a/tests/qtest/readconfig-test.c b/tests/qtest/readconfig-test.c index c6f32a4e144..7e473f98ee0 100644 --- a/tests/qtest/readconfig-test.c +++ b/tests/qtest/readconfig-test.c @@ -132,7 +132,6 @@ static void test_object_available(QObject *res, const char *name, ObjectPropertyInfoList *tmp; ObjectPropertyInfo *obj; bool object_available = false; - g_autofree char *childtype = g_strdup_printf("child<%s>", type); g_assert(res); v = qobject_input_visitor_new(res); @@ -144,7 +143,9 @@ static void test_object_available(QObject *res, const char *name, g_assert(tmp->value); obj = tmp->value; - if (g_str_equal(obj->name, name) && g_str_equal(obj->type, childtype)) { + if (g_str_equal(obj->name, name) + && obj->kind == OBJECT_PROPERTY_KIND_CHILD + && g_str_equal(obj->u.child.qom_type, type)) { object_available = true; break; } -- 2.55.0