qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC] qom: Sorted class enumeration
@ 2012-02-22  9:44 Andreas Färber
  2012-02-22  9:44 ` [Qemu-devel] [PATCH RFC] qom: Introduce object_class_foreach_ordered() Andreas Färber
  2012-02-22 13:25 ` [Qemu-devel] [RFC] qom: Sorted class enumeration Anthony Liguori
  0 siblings, 2 replies; 3+ messages in thread
From: Andreas Färber @ 2012-02-22  9:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, Andreas Färber

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 classes
using the existing foreach infrastructure, on the go via GLib's binary tree.

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 filtering
mechanism (abstract and type) with another callback function or whether that
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 callback.

Regards,
Andreas

Andreas Färber (1):
  qom: Introduce object_class_foreach_ordered()

 include/qemu/object.h |    6 ++++++
 qom/object.c          |   43 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 49 insertions(+), 0 deletions(-)

-- 
1.7.7

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-02-22 13:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-22  9:44 [Qemu-devel] [RFC] qom: Sorted class enumeration Andreas Färber
2012-02-22  9:44 ` [Qemu-devel] [PATCH RFC] qom: Introduce object_class_foreach_ordered() Andreas Färber
2012-02-22 13:25 ` [Qemu-devel] [RFC] qom: Sorted class enumeration Anthony Liguori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).