qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: "Andreas Färber" <afaerber@suse.de>
Cc: pbonzini@redhat.com, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC] qom: Sorted class enumeration
Date: Wed, 22 Feb 2012 07:25:55 -0600	[thread overview]
Message-ID: <4F44ECE3.6070206@codemonkey.ws> (raw)
In-Reply-To: <1329903875-3357-1-git-send-email-afaerber@suse.de>

On 02/22/2012 03:44 AM, Andreas Färber wrote:
> 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 think it might be better to have an object_class_search() function that acts 
like object_class_foreach() but returns a GSList.  You can then call 
g_list_sort() on the resulting data structure.

> 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.

I'd prefer not to do callbacks because this interface gets exposed via QMP and 
callbacks can't be modeled via QMP.

Regards,

Anthony Liguori

>
> 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(-)
>

      parent reply	other threads:[~2012-02-22 13:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Anthony Liguori [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F44ECE3.6070206@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=afaerber@suse.de \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).