libvirt-bin with QEMU ignores KQEMU

Bug #228299 reported by Morten Siebuhr
0
Affects Status Importance Assigned to Milestone
kqemu (Ubuntu)
Invalid
Undecided
Unassigned
libvirt (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: libvirt-bin

There does not seem to be any way to make libvirtd use kqemu instead of qemu. When it launches sub-processes, it explicitly adds the argument "--no-kqemu", with no option for changing this.

From searching on the internet, it seems libvirtd once supported this, but RedHat removed the feature as they did not ship KQEMU...

Revision history for this message
Morten Siebuhr (msiebuhr) wrote :

It can be hacked by moving /usr/bin/qemu to /usr/bin/qemu-original and inserting this script as /usr/bin/qemu (remember permissions):

#!/usr/bin/env python
#
# Wrapper for /usr/bin/qemu to forcefully enable kqemu support
#
# Morten Siebuhr
# <sbhr sbhr dk>

from sys import argv
from os import system, execv
from os.path import exists

original_file = "/usr/bin/qemu-original"

if not exists('/dev/kqemu'):
    print "Cannot run kqemu - the device does not exist!"
else:
    if '-no-kqemu' in argv:
        argv[argv.index('-no-kqemu')] = '-kernel-kqemu'

execv(original_file, argv)

Revision history for this message
Morten Siebuhr (msiebuhr) wrote :

It seems this isn't a bug, but an error on my behalf; I read the documentation on most homepages and guides for creating new virtual machines using virt-install implies that the --accelerate flag requires KVM to work - but reading the man-page, it enables *any* acceleration it may find, being KVM, KQEMU or none at all. If you leave it out, it explicitly forces the virtual machine not to use any acceleration at all (i.e. setting the '-no-kqemu' argument).

Changed in libvirt:
status: New → Invalid
Changed in kqemu:
status: New → Invalid
Revision history for this message
David Sugar (dyfet-deactivatedaccount) wrote :

Morten,

this issue had confused me also as I never had hardware that supports kvm. Reading your notes, if you do enable acceleration in virt-install (and does this also apply to launching it through virtual machine manager "new" virtual machine creation) and have kqemu built, just asking to confirm, qemu will then be executed without the -no-kqemu flag being added? If so, I may take a much more serious look at the vmm stuff, as I had been using qemu directly over what may be the same mistaken belief in this issue.

Loosly related (to be noted as a separate issue in the qemu package), on amd64, /usr/bin/qemu is sym-linked to qemu-system-i386, not qemu-system-x86_64. I am not sure if maybe this was needed for kvm (having never had the chance to use it :), but kqemu does require the arch to match.

Finally, it is worth noting that kqemu does have seem to have an additional option over kvm, -kernel-kqemu, and hence I presume there is no direct way to manipulate this currently through vmm driven qemu. This suggests maybe there is yet some need for some kqemu specific support action based on this bug report.

.

Revision history for this message
Morten Siebuhr (msiebuhr) wrote :

I recall that reading the source code was the easiest way to understand what was done where.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.