Re: RFC: libosinfo: Library for virt OS/distro metadata 3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

The lifetime rules are such that an entry exists whilst the handle is
open, so there's no issues with borrowing pointers in the callback etc.

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

regards
john

_______________________________________________
et-mgmt-tools mailing list
et-mgmt-tools@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/et-mgmt-tools

[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux