Bug 840444 - qemu is built without KVM support
Summary: qemu is built without KVM support
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: qemu
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Fedora Virtualization Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-07-16 12:01 UTC by Alexander Bokovoy
Modified: 2013-01-09 12:05 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-07-18 21:34:25 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Alexander Bokovoy 2012-07-16 12:01:47 UTC
Description of problem:
As of 2:1.1.0-7, Qemu in Rawhide is built with KVM support disabled.

Since no explicit option for enabling or disabling KVM is passed to configure in qemu.spec, Qemu makes own decision whether to enable or disable KVM.

In http://kojipkgs.fedoraproject.org//packages/qemu/1.1.0/7.fc18/data/logs/x86_64/build.log one can see that KVM is disabled:
....
Install blobs     yes
KVM support       no
TCG interpreter   no
....

Version-Release number of selected component (if applicable):
2:1.1.0-7

How reproducible:
Always

Steps to Reproduce:
1. Install Rawhide
2. Run
/usr/bin/qemu-system-x86_64 -enable-kvm -no-user-config -device ? -device pci-assign,? -device virtio-blk-pci,? -device virtio-net-pci,? -device scsi-disk,?  
3. Notice the output

Actual results:
KVM not supported for this target
No accelerator found!

Comment 1 Richard W.M. Jones 2012-07-16 12:10:07 UTC
The sources are built twice.  The first time:

  KVM support       yes

as you can see in that build log.

Actually the build process for qemu-kvm is very complex (probably
unnecessarily so) and I haven't really looked at it.  Also the
command line options to enable and disable KVM are frustrating
complex and undocumented, so I don't even know whether the output
from the command above is correct or not.

There is a separate bug in upstream qemu-kvm.git which we have
tried to work around with a patch.  This bug affects libvirt,
although the patch doesn't help:

http://pkgs.fedoraproject.org/gitweb/?p=qemu.git;a=blob;f=0001-qemu-kvm-Fix-default-machine-options.patch;h=fc9e2e019b5d4d11bedd36efe271a398005339de;hb=HEAD

Comment 2 Alexander Bokovoy 2012-07-16 12:16:12 UTC
The end result is that qemu-system-x86_64 in the package does not have KVM support and the whole libvirtd setup which previously worked does not work.

So what to do with it?

Comment 3 Richard W.M. Jones 2012-07-16 12:24:45 UTC
I really think you're seeing a different bug (one which also
affects me).  libvirt fails to detect the capabilities of
this version of qemu.  I've no idea how to fix this, although
I have made several attempts.  Please ask Dan Berrange.

Comment 4 Alexander Bokovoy 2012-07-16 12:46:09 UTC
Ok, so what happens is following:

Upon start libvirtd will run system-specific qemu binary to discover possible options. In my case it is qemu-system-x86_64 and it is the version *without* KVM support.

Command line that libvirtd runs is:
/usr/bin/qemu-system-x86_64 -no-user-config -device ? -device pci-assign,? -device virtio-blk-pci,? -device virtio-net-pci,? -device scsi-disk,?

Basically, this commandline fails due to absent accelerator, as instructed in qemu's vl.c:configure_accelerator() (2134-2154 in upstream qemu code). Since all accelerators are not available, no accelerator is initialized and qemu exits.

As a workaround right now I did symlinked qemu-system-x86_64 to qemu-kvm and everything started working.

What is the reason to supply qemu-system-x86_64 binary without kvm support by default? 

Can we use alternatives to configure actual qemu-system-x86_64 binary and default to KVM?

Comment 5 Richard W.M. Jones 2012-07-16 15:51:16 UTC
For the libvirt problem, try the -8 package from here:
http://koji.fedoraproject.org/koji/taskinfo?taskID=4243685
This fixes all known libvirt+qemu problems for me.

Comment 6 Alexander Bokovoy 2012-07-17 10:34:52 UTC
I can confirm that 1.1.0-8 solves the issue for me.

Thanks!


Note You need to log in before you can comment on or make changes to this bug.