[fedora-virt] Re: RFC: libosinfo: Library for virt OS/distro metadata 3
Daniel P. Berrange
berrange at redhat.com
Mon Jun 15 16:00:00 UTC 2009
On Mon, Jun 15, 2009 at 11:50:18AM -0400, John Levon wrote:
> On Mon, Jun 15, 2009 at 04:27:49PM +0100, Daniel P. Berrange wrote:
> > > > - Find OS distros, matching a specific set of properties
> > >
> > > What uses do you have in mind for this? Being able to say e.g. 'all
> > > distros that support xen PV for IA64'?
> > >
> > > How do you think an API call would look?
> > Just a function callback for doing the filtering. If the callback
> > returned 1 the distro object is kept, otherwise it is discarded.
> > typedef int (*osfilter-t)(osdistro_t *distro, void *opaque);
> > osdistro_t **os_distro_find(osinfo_t, osfilter_t filter, void *opaque);
> I don't really like the idea of filtering. Instead it should just be a
> callback API full stop. It's up to the client if they want to filter, or
> find a specific entry, or whatever.
So you mean that it can just be a list iterator pattern
typedef int (*osdistro_iter)(osdistro_t *distro, void *opaque);
int os_distro_iterate(osinfo_t, osdistro_iter iter, void *opaque);
> > Imagine virt-manager building a 2 level hiearchy. For the first level
> > it wants to use this method
> > - Get a list of uninque vendor names among all known OS distros
> Pruning duplicates is surely something done in the client. It
> really doesn't need library help...
I was thinking that it may well be more efficient to let the library do it.
That said, this is an optimization we can add later if observed to be
neccessary in real world
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
More information about the Fedora-virt