[libvirt] How to config my VM to use KVM with libvirt?

Jim Paris jim at jtan.com
Tue Jul 21 13:46:17 UTC 2009


Daniel P. Berrange wrote:
> On Tue, Jul 21, 2009 at 05:47:15PM +0900, Jun Koi wrote:
> > Hi,
> > 
> > I have a VM running under libvirt, and it is currently run with
> > -no-kvm option (I saw that in "ps" output).
> > Now I want to run this VM with KVM. How can I reconfigure it for that?
> > 
> > I looked into its configuration file under /etc/libvirt/qemu, but
> > didnt see any option to turn KVM on.
> 
> Run 'virsh edit GUEST'  and on the top <domain> element, change the
> type attribute to be 'kvm' instead of 'qemu'.

Speaking of this, I've noticed that

<domain type='qemu'>
  <os>
    <type arch='i686' machine='pc'>hvm</type>
  </os>
</domain>

runs WITH kvm on an x86_64 system.  Is that intended?
It seems that this comment in qemu_conf.c:

    /* Need to explicitly disable KVM if
     * 1. Arch matches host arch
     * 2. Guest domain is 'qemu'
     * 3. The qemu binary has the -no-kvm flag
     */

might need to expand #1 to consider i686 == x86_64?

-jim




More information about the libvir-list mailing list