On 06/15/2009 08:15 AM, Richard W.M. Jones wrote:
On Sun, Jun 14, 2009 at 06:50:02PM -0400, Cole Robinson wrote:
The public API looks like:
/**
- Values stored in the OS dictionary
*/ enum _os_value_type { OS_VALUE_NAME = 1, /** Human readable family/distro... name */ OS_VALUE_MEDIA_INSTALL_URL, /** URL to an install tree */ }; typedef enum _os_value_type os_value_t;
int os_init(); void os_close();
int os_find_families (char ***list); int os_find_distros (const char *parent_id, char ***list); int os_find_releases (const char *parent_id, char ***list); int os_find_updates (const char *parent_id, char ***list);
int os_lookup_value (os_value_t value_type, const char *os_id, char **value);
There's a (little) overlap and a possible user in virt-inspector.
In virt-inspector we do things the other way around - we look inside the guest for files like /etc/redhat-release and /etc/debian_version, and parse those to determine the OS distro and release (also we parse the registry to do the same for Windows). The code for Linux is here:
http://git.et.redhat.com/?p=libguestfs.git;a=blob;f=inspector/virt-inspector...
It would be nice for virt-inspector to output ID strings which are compatible with osinfo.
Agreed, I was thinking something along the same lines.
'Course we'll need Perl bindings. Did you see this?
Thanks, I'll take a look.
- Cole