aboutsummaryrefslogtreecommitdiff
path: root/qom
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2022-11-04 17:07:02 +0100
committerMarkus Armbruster <armbru@redhat.com>2022-12-14 20:05:07 +0100
commit047f2ca1cec9cdb226f4eac7e672f753089a42ee (patch)
treeda8ed09083443ba8bfa89562f328fbfdd47cb852 /qom
parent0846aaf77cfded0cab5dfc23715f0ebb03e5289a (diff)
qapi qdev qom: Elide redundant has_FOO in generated C
The has_FOO for pointer-valued FOO are redundant, except for arrays. They are also a nuisance to work with. Recent commit "qapi: Start to elide redundant has_FOO in generated C" provided the means to elide them step by step. This is the step for qapi/qdev.json and qapi/qom.json. Said commit explains the transformation in more detail. The invariant violations mentioned there do not occur here. Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: Daniel P. Berrangé <berrange@redhat.com> Cc: Eduardo Habkost <eduardo@habkost.net> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20221104160712.3005652-21-armbru@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Diffstat (limited to 'qom')
-rw-r--r--qom/qom-qmp-cmds.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/qom/qom-qmp-cmds.c b/qom/qom-qmp-cmds.c
index 2e63a4c184..7c087299de 100644
--- a/qom/qom-qmp-cmds.c
+++ b/qom/qom-qmp-cmds.c
@@ -99,15 +99,13 @@ static void qom_list_types_tramp(ObjectClass *klass, void *data)
info->name = g_strdup(object_class_get_name(klass));
info->has_abstract = info->abstract = object_class_is_abstract(klass);
if (parent) {
- info->has_parent = true;
info->parent = g_strdup(object_class_get_name(parent));
}
QAPI_LIST_PREPEND(*pret, info);
}
-ObjectTypeInfoList *qmp_qom_list_types(bool has_implements,
- const char *implements,
+ObjectTypeInfoList *qmp_qom_list_types(const char *implements,
bool has_abstract,
bool abstract,
Error **errp)
@@ -168,10 +166,8 @@ ObjectPropertyInfoList *qmp_device_list_properties(const char *typename,
info = g_new0(ObjectPropertyInfo, 1);
info->name = g_strdup(prop->name);
info->type = g_strdup(prop->type);
- info->has_description = !!prop->description;
info->description = g_strdup(prop->description);
info->default_value = qobject_ref(prop->defval);
- info->has_default_value = !!info->default_value;
QAPI_LIST_PREPEND(prop_list, info);
}
@@ -215,7 +211,6 @@ ObjectPropertyInfoList *qmp_qom_list_properties(const char *typename,
info = g_malloc0(sizeof(*info));
info->name = g_strdup(prop->name);
info->type = g_strdup(prop->type);
- info->has_description = !!prop->description;
info->description = g_strdup(prop->description);
QAPI_LIST_PREPEND(prop_list, info);