Bug 700369
Summary: | qemu-system-x86_64 says 'KVM not supported for this target' | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Marek Goldmann <mgoldman> |
Component: | qemu | Assignee: | Justin M. Forbes <jforbes> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 15 | CC: | amit.shah, armbru, berrange, dwmw2, ehabkost, gcosta, itamar, jaswinder, jforbes, knoel, markmc, mbooth, ondrejj, rjones, scottt.tw, virt-maint |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libguestfs-1.10.4-1.fc15 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2011-05-17 19:09:02 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Marek Goldmann
2011-04-28 08:56:39 UTC
We already check if KVM is available by checking if /dev/kvm exists: src/launch.c: if (qemu_supports (g, "-enable-kvm") && is_openable (g, "/dev/kvm", O_RDWR)) add_cmdline (g, "-enable-kvm"); Can you see if /dev/kvm exists, and what permissions it has? Does this machine use udev, or is /dev directory hard-coded? The problem is that qemu-system-x86_64 advertizes the -enable-kvm option: $ qemu-system-x86_64 --help | grep enable-kvm -enable-kvm enable KVM full virtualization support But then completely rejects it: $ qemu-system-x86_64 -enable-kvm -hdc /dev/null KVM not supported for this target (It doesn't even open /dev/kvm or check for it in any way). This is a qemu bug basically. Markus, can you suggest the correct / reliable way that we should be using so that we get KVM if it's available, but otherwise fall back to TCG, which will work across all versions of qemu and KVM? Unfortunately, there is no way to ask for "KVM or else TCG" that works across versions. With qemu-kvm, it is the default. With upstream qemu, it's simply not possible. You could simply assume qemu-kvm semantics on the hypothesis that anyone who cares for KVM will use qemu-kvm for production. If you use qemu, you get TCG. If you must have KVM even with upstream qemu, you can try with -enable-kvm, recognize "no KVM support" failure, retry without. Recognizing the failure will be relatively brittle, I'm afraid. Or start an extra instance just to run "info kvm" in the monitor. Please don't shoot the messenger... Additional info: upstream qemu | default |-enable-kvm ----------------+-----------+----------- KVM available | disabled | enabled KVM unavailable | disabled | fail qemu-kvm old | default |-enable-kvm| -no-kvm ----------------+-----------+-----------+---------- KVM available | enabled* | enabled | disabled KVM unavailable | disabled | disabled* | disabled qemu-kvm new | default |-enable-kvm| -no-kvm ----------------+-----------+-----------+---------- KVM available | enabled* | enabled | disabled KVM unavailable | disabled | fail+ | disabled OK, but you see why this is why we want proper qemu capabilities. I understand why a robust way to test for feature availability is desirable. Unfortunately, upstream has rejected all attempts to provide it so far. Another case of perfect being the enemy of good. Re: Marek suggested testing for vmx|svm in /proc/cpuinfo flags. That's not going to work. The problem is not that the hardware doesn't support hardware virt, but that qemu advertizes the -enable-kvm option but doesn't implement it. It's entirely a problem with qemu. Want me to try to get upstream qemu's default changed to match qemu-kvm's? Chance of success is unpredictable. A better thing (perhaps easier) would be to remove -enable-kvm from the qemu help output when it's not actually supported by the built binary ... Patch posted upstream: https://www.redhat.com/archives/libguestfs/2011-May/msg00070.html This requires the new qemu -machine option which is not yet widely available, but it seems to be the best we can do. Pushed upstream: http://git.annexia.org/?p=libguestfs.git;a=commit;h=64841fe8957f798df12a38bd81843c7011f2c278 and available in libguestfs >= 1.11.7. libguestfs-1.10.4-1.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/libguestfs-1.10.4-1.fc15 libguestfs-1.10.4-1.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report. |