Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 502586

Summary: RHEL5.4: qemu-kvm should not fall back to TCG if KVM is not available
Product: Red Hat Enterprise Linux 5 Reporter: Mark McLoughlin <markmc>
Component: kvmAssignee: Eduardo Habkost <ehabkost>
Status: CLOSED DUPLICATE QA Contact: Lawrence Lim <llim>
Severity: medium Docs Contact:
Priority: high    
Version: 5.4CC: berrange, ovirt-maint, tburke, tools-bugs
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-27 09:07:50 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 Mark McLoughlin 2009-05-26 10:07:54 UTC
If you run qemu-kvm on a machine which doesn't support KVM, it will fallback to CPU emulation using TCG:

  $> mv /dev/kvm /dev/kvm.orig
  $> qemu-kvm -drive file=/var/lib/libvirt/images/test3.img -net none \
              -monitor stdio -serial telnet::4444,server,nowait -nographic
  open /dev/kvm: No such file or directory
  Could not initialize KVM, will disable KVM support

We don't want to support TCG, so we should disable this fallback.

In theory, building with --disable-cpu-emulation does just that, but it doesn't build right now, even upstream.

Comment 1 Daniel Berrangé 2009-05-26 10:38:34 UTC
IMHO disabling this is a bad idea - just consider the needs of libguestfs as one example. Its RPM build process runs KVM. The RHEL/Fedora mock/koji environment runs inside a virtual machine. Ergo, there is no hardware virt available during builds. So if we remove the fallback for TCG, it'll unnecessarily cause the builds to fail.

Comment 2 Mark McLoughlin 2009-05-26 13:35:26 UTC
Well, there's two issues:

  1) What to do long term - the fallback will probably disappear as part of
     merging KVM upstream things like libguestfs will have to explicitly 
     fall back themselves.

  2) Whether we want to support TCG in 5.4 - IMHO, we don't and people who
     want TCG (for whatever reason) should use qemu from EPEL

Comment 3 Mark McLoughlin 2009-05-26 15:47:19 UTC
Alternative discussed solution is:

 1) Move /usr/bin/qemu-kvm to /usr/libexec/qemu-kvm

 2) Make /usr/bin/qemu-kvm a script which checks whether KVM is available
    and and, if not, warns that TCG is not supported

Rationale is that TCG *is* needed for RHEV-M - apparently it uses qemu -no-kvm for some use cases

Comment 4 Dor Laor 2009-05-27 09:07:50 UTC
(In reply to comment #3)
> Alternative discussed solution is:
> 
>  1) Move /usr/bin/qemu-kvm to /usr/libexec/qemu-kvm
> 
>  2) Make /usr/bin/qemu-kvm a script which checks whether KVM is available
>     and and, if not, warns that TCG is not supported
> 
> Rationale is that TCG *is* needed for RHEV-M - apparently it uses qemu -no-kvm
> for some use cases  

Since I have an open bug that should do exactly that + rhev-M needs -no-kvm mode
I'm closing this bug.

Comment 5 Mark McLoughlin 2009-05-27 09:28:33 UTC

*** This bug has been marked as a duplicate of bug 489654 ***