[libvirt] [PATCH] kvm 32bit guest on 64bit host

Hi, I want to manage a 32 bit i686 guest on an x86_64 host with kvm and libvirt. KVM is perfectly capable of doing this (look e.g. at http://kvm.qumranet.com/kvmwiki/Guest_Support_Status) but libvirt did not allow it. So I created the attached patch to allow it and make it easy to extend the capabilities of kvm and kqemu later on. I did not add anything I'm not sure about, so I did not at 64bit guest on 32bit host (though the page linked above seems to indicate that it works) and did not change the capabilities of kqemu at all (because I don't have any experience with it and never used it). Please consider merging. Kind regards, Gerd -- Address (better: trap) for people I really don't want to get mail from: james@cactusamerica.com

On Tue, Jun 03, 2008 at 01:13:29AM +0200, Gerd von Egidy wrote:
Hi,
I want to manage a 32 bit i686 guest on an x86_64 host with kvm and libvirt. KVM is perfectly capable of doing this (look e.g. at http://kvm.qumranet.com/kvmwiki/Guest_Support_Status) but libvirt did not allow it.
So I created the attached patch to allow it and make it easy to extend the capabilities of kvm and kqemu later on.
This is incorrect. KVM is *not* exposing a i686 architecture CPU. It is exposing an x86_64 virtualized CPU which is capable of running x86_64 or i686 guests. No change is required. Dan. -- |: 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 :|

Hi Daniel,
I want to manage a 32 bit i686 guest on an x86_64 host with kvm and libvirt. KVM is perfectly capable of doing this (look e.g. at http://kvm.qumranet.com/kvmwiki/Guest_Support_Status) but libvirt did not allow it.
So I created the attached patch to allow it and make it easy to extend the capabilities of kvm and kqemu later on.
This is incorrect. KVM is *not* exposing a i686 architecture CPU. It is exposing an x86_64 virtualized CPU which is capable of running x86_64 or i686 guests. No change is required.
Thanks for looking at my patch. I understand that KVM does not offer a i686 host cpu but allows x86_64 and i686 guests. The reason for my patch was that I could not create i686 guests on a x86_64 host with KVM, the only option offered was using qemu. I'm new to libvirt so I'm not that familiar with the capabilities-xml - so take my findings with some salt ;) Without my patch the capabilities look like this: <capabilities> <host> <cpu> <arch>x86_64</arch> </cpu> </host> <guest> <os_type>hvm</os_type> <arch name='i686'> <wordsize>32</wordsize> <emulator>/usr/bin/qemu</emulator> <machine>pc</machine> <machine>isapc</machine> <domain type='qemu'> </domain> </arch> <features> <pae/> <nonpae/> <acpi default='on' toggle='yes'/> <apic default='on' toggle='no'/> </features> </guest> <guest> <os_type>hvm</os_type> <arch name='x86_64'> <wordsize>64</wordsize> <emulator>/usr/bin/qemu-system-x86_64</emulator> <machine>pc</machine> <machine>isapc</machine> <domain type='qemu'> </domain> <domain type='kvm'> <emulator>/usr/bin/qemu-kvm</emulator> </domain> </arch> <features> <acpi default='on' toggle='yes'/> <apic default='on' toggle='no'/> </features> </guest> ... (mips, sparc, etc. omitted) The i686-guest section does not have a kvm-domain. So libvirt does not allow the use of kvm for i686 guests. With my patch the capabilities are: <capabilities> <host> <cpu> <arch>x86_64</arch> </cpu> </host> <guest> <os_type>hvm</os_type> <arch name='i686'> <wordsize>32</wordsize> <emulator>/usr/bin/qemu</emulator> <machine>pc</machine> <machine>isapc</machine> <domain type='qemu'> </domain> <domain type='kvm'> <emulator>/usr/bin/qemu-kvm</emulator> </domain> </arch> <features> <pae/> <nonpae/> <acpi default='on' toggle='yes'/> <apic default='on' toggle='no'/> </features> </guest> <guest> <os_type>hvm</os_type> <arch name='x86_64'> <wordsize>64</wordsize> <emulator>/usr/bin/qemu-system-x86_64</emulator> <machine>pc</machine> <machine>isapc</machine> <domain type='qemu'> </domain> <domain type='kvm'> <emulator>/usr/bin/qemu-kvm</emulator> </domain> </arch> <features> <acpi default='on' toggle='yes'/> <apic default='on' toggle='no'/> </features> </guest> ... (mips, sparc, etc. omitted) As you can see the i686 guest section gained a kvm-domain with my patch which allows me to install i686 KVM-guests on x86_64 hosts. Kind regards, Gerd

On Tue, Jun 03, 2008 at 11:49:59AM +0200, Gerd v. Egidy wrote:
Hi Daniel,
I want to manage a 32 bit i686 guest on an x86_64 host with kvm and libvirt. KVM is perfectly capable of doing this (look e.g. at http://kvm.qumranet.com/kvmwiki/Guest_Support_Status) but libvirt did not allow it.
So I created the attached patch to allow it and make it easy to extend the capabilities of kvm and kqemu later on.
This is incorrect. KVM is *not* exposing a i686 architecture CPU. It is exposing an x86_64 virtualized CPU which is capable of running x86_64 or i686 guests. No change is required.
Thanks for looking at my patch. I understand that KVM does not offer a i686 host cpu but allows x86_64 and i686 guests.
The reason for my patch was that I could not create i686 guests on a x86_64 host with KVM, the only option offered was using qemu.
Yes you can - just select the x86_64 option. It is refering to the *CPU* architecture that is virtualized, *not* the OS architecture. You can select x86_64 CPU and then install a i386 operating system just fine. Dan. -- |: 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 :|

Hi Dan,
Thanks for looking at my patch. I understand that KVM does not offer a i686 host cpu but allows x86_64 and i686 guests.
The reason for my patch was that I could not create i686 guests on a x86_64 host with KVM, the only option offered was using qemu.
Yes you can - just select the x86_64 option. It is refering to the *CPU* architecture that is virtualized, *not* the OS architecture. You can select x86_64 CPU and then install a i386 operating system just fine.
I'm using virt-manager to create a new vm. Virt-manager asks me "CPU architecture" and "Hypervisor". When I select i686 as CPU arch I can not select KVM as hypervisor, only qemu is offered. If I understand you correctly, I should select x86_64 and KVM, even if I want to run a 32 bit OS, right? Isn't that counter-intuitive? Kind regards, Gerd

On Tue, Jun 03, 2008 at 12:06:58PM +0200, Gerd v. Egidy wrote:
Hi Dan,
Thanks for looking at my patch. I understand that KVM does not offer a i686 host cpu but allows x86_64 and i686 guests.
The reason for my patch was that I could not create i686 guests on a x86_64 host with KVM, the only option offered was using qemu.
Yes you can - just select the x86_64 option. It is refering to the *CPU* architecture that is virtualized, *not* the OS architecture. You can select x86_64 CPU and then install a i386 operating system just fine.
I'm using virt-manager to create a new vm. Virt-manager asks me "CPU architecture" and "Hypervisor". When I select i686 as CPU arch I can not select KVM as hypervisor, only qemu is offered.
If I understand you correctly, I should select x86_64 and KVM, even if I want to run a 32 bit OS, right?
Yes. Dan. -- |: 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 :|

Gerd v. Egidy wrote:
Hi Dan,
Thanks for looking at my patch. I understand that KVM does not offer a i686 host cpu but allows x86_64 and i686 guests.
The reason for my patch was that I could not create i686 guests on a x86_64 host with KVM, the only option offered was using qemu. Yes you can - just select the x86_64 option. It is refering to the *CPU* architecture that is virtualized, *not* the OS architecture. You can select x86_64 CPU and then install a i386 operating system just fine.
I'm using virt-manager to create a new vm. Virt-manager asks me "CPU architecture" and "Hypervisor". When I select i686 as CPU arch I can not select KVM as hypervisor, only qemu is offered.
If I understand you correctly, I should select x86_64 and KVM, even if I want to run a 32 bit OS, right?
Isn't that counter-intuitive?
This has confused quite a few people in the past (including myself). We should probably add some better wording in virt-manager or some kind of note explaining the terminology, but no matter what way you slice it it's still easy to get tripped up on the concepts. - Cole
参加者 (4)
-
Cole Robinson
-
Daniel P. Berrange
-
Gerd v. Egidy
-
Gerd von Egidy