Received: from eggs.gnu.org ([140.186.70.92]:33743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S08kZ-0001fz-TD for qemu-devel@nongnu.org; Wed, 22 Feb 2012 04:44:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S08kY-0007gG-UY for qemu-devel@nongnu.org; Wed, 22 Feb 2012 04:44:39 -0500 Received: from cantor2.suse.de ([195.135.220.15]:60528 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S08kY-0007g7-Nj for qemu-devel@nongnu.org; Wed, 22 Feb 2012 04:44:38 -0500 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Wed, 22 Feb 2012 10:44:34 +0100 Message-Id: <1329903875-3357-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [RFC] qom: Sorted class enumeration List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, =?UTF-8?q?Andreas=20F=C3=A4rber?= Hello, For listing registered CPU classes I needed a way to sort classes in a custom (i.e., non-hashtable) order. I found it easiest to sort the classe= s using the existing foreach infrastructure, on the go via GLib's binary tr= ee. Patch is still missing documentation, but do you think this is the right direction, Anthony? I've been wondering if it might make sense to replace the current filteri= ng mechanism (abstract and type) with another callback function or whether t= hat would be overkill - currently the only other filtering I needed to do was to ignore the "host" CPU class, which can be done by simple if in the cal= lback. Regards, Andreas Andreas F=C3=A4rber (1): qom: Introduce object_class_foreach_ordered() include/qemu/object.h | 6 ++++++ qom/object.c | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 0 deletions(-) --=20 1.7.7