2011/1/12 Justin Clift <jclift(a)redhat.com>:
On 11/01/2011, at 12:53 PM, Jake Xu wrote:
> Hi,
>
> I am trying to create a VM using the Python bindings of Libvirt. I can successfully
create VM from a XML template, but I can't find any way to define the guest OS
type/variant like CentOS 5.5 64bit for my VM. The native format converted from XML is
always guestOS="other-64" - which doesn't tell us much about the guest
operating system.
>
> I have looked at the C libvirt source code a bit, and it seems like libvirt does not
support defining guest os type using XML description yet.
Ouch, that sounds less than optimal.
> Is there any way I can set the guest OS type for my VM?
I'm not a Python programmer, but wondering if you'd be able to cheat by looking
how virt-manager does it?
http://virt-manager.org/scmrepo.html
Virt-manager uses Mercurial for source control, which unfortunately I don't know how
to work with either, so
can't point you directly to the right file to check.
But, if you want to look, you should be able to check out the repository (however
Mercurial does it) and then
find the right code pretty fast.
Is that helpful?
Regards and best wishes,
Justin Clift
virt-install/virt-manager allow you to pick a guest OS type and
variant to select other config options based on that, but the
selection is not passed down to the libvirt level. So it doesn't help
to look for this in the virt-install/virt-manager source code :)
Matthias