[fedora-virt] RFC: libosinfo: Library for virt OS/distro metadata 3

Richard W.M. Jones rjones at redhat.com
Mon Jun 15 12:15:06 UTC 2009

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:


It would be nice for virt-inspector to output ID strings which are
compatible with osinfo.

'Course we'll need Perl bindings.  Did you see this?



Richard Jones, Emerging Technologies, Red Hat  http://et.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.

More information about the Fedora-virt mailing list