RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1628469 - libvirt uses incorrect method to detect that KVM is working
Summary: libvirt uses incorrect method to detect that KVM is working
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.7
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: 7.7
Assignee: Andrea Bolognani
QA Contact: yalzhang@redhat.com
URL:
Whiteboard:
Depends On: 1628468
Blocks: 1598750 1605071 1619379 1629862 1707454
TreeView+ depends on / blocked
 
Reported: 2018-09-13 07:44 UTC by Richard W.M. Jones
Modified: 2019-08-06 13:14 UTC (History)
11 users (show)

Fixed In Version: libvirt-4.5.0-13.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1629862 (view as bug list)
Environment:
Last Closed: 2019-08-06 13:13:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
IBM Linux Technology Center 171492 0 None None None 2019-07-26 05:54:32 UTC
Red Hat Product Errata RHSA-2019:2294 0 None None None 2019-08-06 13:14:34 UTC

Description Richard W.M. Jones 2018-09-13 07:44:18 UTC
Description of problem:

https://github.com/libvirt/libvirt/blob/e9e904b3b70533982954ab39ccb81122e8dad338/src/qemu/qemu_capabilities.c#L837

Just checking the existence of /dev/kvm is no good.  This
node always exists since:

$ cat /usr/lib/udev/rules.d/80-kvm.rules
KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"

It does not guarantee that KVM works.

I have filed https://bugzilla.redhat.com/show_bug.cgi?id=1628468
to get the KVM team to suggest or implement a reliable test.

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

All recent libvirt.

Steps to Reproduce:

On a machine where KVM is broken:

  virsh capabilities

It will show KVM is available.

Comment 2 Andrea Bolognani 2018-09-14 08:37:11 UTC
Patches posted upstream.

  https://www.redhat.com/archives/libvir-list/2018-September/msg00651.html

Comment 3 Andrea Bolognani 2018-09-17 14:30:09 UTC
Fix merged upstream.

  commit 88983855d5496a74b97551860db737c2b17b100e
  Author: Andrea Bolognani <abologna>
  Date:   Thu Sep 13 17:40:51 2018 +0200

    qemu: Drop QEMU_CAPS_ENABLE_KVM
    
    It was already available in 1.5.0.
    
    Moreover, we're not even formatting it on the QEMU command
    line, ever: we just use it as part of some logic that decides
    whether KVM support should be advertised, and as it turns out
    that logic is actually buggy and dropping this capability
    fixes it.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1628469
    
    Signed-off-by: Andrea Bolognani <abologna>
    Reviewed-by: Jiri Denemark <jdenemar>

v4.7.0-141-g88983855d5

Comment 4 Joseph Kachuck 2018-10-17 19:14:36 UTC
Hello,
RHEL ALT 7.6 is the last release of RHEL ALT. There will be one final release of RHEL ALT 7.6.z.
Only critical bugs will be accepted for this release. If this bug is required for RHEL ALT 7.6 ALT. 
Please provide a justification why this is required for Z stream. Please confirm what a client would see in the field from this issue.

Thank You
Joe Kachuck

Comment 9 yalzhang@redhat.com 2019-06-11 09:32:44 UTC
Reproduce this bug on libvirt-4.5.0-11.el7.x86_64
1. prepare a host which KVM is broken, but /dev/kvm exists:
# modprobe -r kvm_intel
# modprobe -r kvm
# mknod /dev/kvm c 10 232

2. make sure /dev/kvm is there:
# ls /dev/kvm 
/dev/kvm

3. check virsh capabilities output:
# virsh capabilities
...
  <guest>
    <os_type>hvm</os_type>
    <arch name='x86_64'>
...
    <domain type='qemu'/>
      <domain type='kvm'>
        <emulator>/usr/libexec/qemu-kvm</emulator>
      </domain>
...
 </guest>

Update libvirt to libvirt-4.5.0-21.el7.x86_64, and check again:
1.
# yum update libvirt libvirt* -y
# systemctl restart libvirtd
# rpm -q libvirt
libvirt-4.5.0-21.el7.x86_64

2.
# virsh capabilities 
<capabilities>
...
 <guest>
    <os_type>hvm</os_type>
    <arch name='x86_64'>
...
  <domain type='qemu'/>
 </guest>

</capabilities>

There is no "<domain type='kvm'>" in the "# virsh capabilities" outputs any more.

3. Restore the settings and check again:
# rm -f /dev/kvm
# modprobe kvm_intel
# modprobe kvm
# virsh capabilities
<capabilities>
...
 <guest>
    <os_type>hvm</os_type>
    <arch name='i686'>
...
 <domain type='qemu'/>
      <domain type='kvm'>
        <emulator>/usr/libexec/qemu-kvm</emulator>
      </domain>
...
</guest>
<guest>
    <os_type>hvm</os_type>
    <arch name='x86_64'>
...
  <domain type='qemu'/>
      <domain type='kvm'>
        <emulator>/usr/libexec/qemu-kvm</emulator>
      </domain>
...
</guest>

The result is as expected, set the bug to be verified.

Comment 11 errata-xmlrpc 2019-08-06 13:13:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:2294


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