summaryrefslogtreecommitdiff
path: root/qom
diff options
context:
space:
mode:
Diffstat (limited to 'qom')
-rw-r--r--qom/object.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/qom/object.c b/qom/object.c
index 755ad03819..6088f55943 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -891,6 +891,19 @@ GSList *object_class_get_list(const char *implements_type,
return list;
}
+static gint object_class_cmp(gconstpointer a, gconstpointer b)
+{
+ return strcasecmp(object_class_get_name((ObjectClass *)a),
+ object_class_get_name((ObjectClass *)b));
+}
+
+GSList *object_class_get_list_sorted(const char *implements_type,
+ bool include_abstract)
+{
+ return g_slist_sort(object_class_get_list(implements_type, include_abstract),
+ object_class_cmp);
+}
+
void object_ref(Object *obj)
{
if (!obj) {