aboutsummaryrefslogtreecommitdiff
path: root/qdev-monitor.c
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 /qdev-monitor.c
parent819fd4699c7b36d574292bcbd8bc25e9d716c84b (diff)
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 'qdev-monitor.c')
-rw-r--r--qdev-monitor.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/qdev-monitor.c b/qdev-monitor.c
index b7e3291f8b..61e0300991 100644
--- a/qdev-monitor.c
+++ b/qdev-monitor.c
@@ -122,12 +122,6 @@ static void qdev_print_devinfo(DeviceClass *dc)
error_printf("\n");
}
-static gint devinfo_cmp(gconstpointer a, gconstpointer b)
-{
- return strcasecmp(object_class_get_name((ObjectClass *)a),
- object_class_get_name((ObjectClass *)b));
-}
-
static void qdev_print_devinfos(bool show_no_user)
{
static const char *cat_name[DEVICE_CATEGORY_MAX + 1] = {
@@ -146,8 +140,7 @@ static void qdev_print_devinfos(bool show_no_user)
int i;
bool cat_printed;
- list = g_slist_sort(object_class_get_list(TYPE_DEVICE, false),
- devinfo_cmp);
+ list = object_class_get_list_sorted(TYPE_DEVICE, false);
for (i = 0; i <= DEVICE_CATEGORY_MAX; i++) {
cat_printed = false;