summaryrefslogtreecommitdiff
path: root/include/qom/object.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2018-03-03 08:33:10 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2018-03-12 15:21:10 +0100
commit47c66009ab793241e8210b3018c77a9ce9506aa8 (patch)
treedb80a563159ab6069416b8c040e63eeedbeeaad0 /include/qom/object.h
parent819fd4699c7b36d574292bcbd8bc25e9d716c84b (diff)
downloadqemu-47c66009ab793241e8210b3018c77a9ce9506aa8.tar.gz
qom: introduce object_class_get_list_sorted
Unify half a dozen copies of very similar code (the only difference being whether comparisons were case-sensitive) and use it also in Tricore, which did not do any sorting of CPU model names. Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/qom/object.h')
-rw-r--r--include/qom/object.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/qom/object.h b/include/qom/object.h
index 4f07090db0..96ce81bc5e 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -914,6 +914,17 @@ GSList *object_class_get_list(const char *implements_type,
bool include_abstract);
/**
+ * object_class_get_list_sorted:
+ * @implements_type: The type to filter for, including its derivatives.
+ * @include_abstract: Whether to include abstract classes.
+ *
+ * Returns: A singly-linked list of the classes in alphabetical
+ * case-insensitive order.
+ */
+GSList *object_class_get_list_sorted(const char *implements_type,
+ bool include_abstract);
+
+/**
* object_ref:
* @obj: the object
*