[virt-tools-list] ostype in virtinst and libvirt

Daniel P. Berrange berrange at redhat.com
Tue Feb 16 14:17:36 UTC 2010


On Tue, Feb 16, 2010 at 09:08:44AM -0500, Cleber Rosa wrote:
> Folks,
> 
> I've been playing around with python-virtinst, with the primary goal of adding an initial round of LXC support to it.
> 
> While reading the code, I've found that "os_type" is quite misleading. This is already recognized and one example is this comment in virtinst/Guest.py:
> 
>     # GAH! - installer.os_type = "hvm" or "xen" (aka xen paravirt)
>     #        guest.os_type     = "Solaris", "Windows", "Linux"
>     # FIXME: We should really rename this property to something else,
>     #        change it throughout the codebase for readability sake, but
>     #        maintain back compat.
> 
> libvirt also refers to "ostype" all over the place, one example is in conf/capabilities.c:
> 
>     * virCapabilitiesAddGuest:
>     * @caps: capabilities to extend
>     * @ostype: guest operating system type ('hvm' or 'xen')
> 
> I feel that, even prior to adding LXC support to python-virtinst, I would benefit from learning more about the code while fixing this. I would like to have feedback on a couple of questions:
> 
>    * Should libvirt be targeted also? Would this have any impact on ABI/API stability?

No, libvirt cannot be changed, since this would break compatability.

>    * Has a consensus been formed about alternative names for "ostype", "installer.os_type", "guest.os_type" and the like?

They're both os types really

 - installer.os_type == OS guest ABI Type
 - guest.os_type     == OS Product Type

the idea of guest.os_type is going to be changing somewhat in the future
when the libosinfo() takes over managing this data, because os type/variant
turns out to be a flawed concept. Operating systems will be referered to
using their full product name, or via a URL alias. As such I'm not sure
that its worth changing virt-install's use of 'os_type' until the time
comes to switch over to libosinfo

Regards,
Daniel
-- 
|: 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 virt-tools-list mailing list