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 1525182 - Should rebuild QEMU capabilities on KVM hosts if kernel version changes
Summary: Should rebuild QEMU capabilities on KVM hosts if kernel version changes
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Jiri Denemark
QA Contact: Luyao Huang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-12-12 17:46 UTC by Paolo Bonzini
Modified: 2018-04-10 11:03 UTC (History)
9 users (show)

Fixed In Version: libvirt-3.9.0-9.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 11:02:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:0704 0 None None None 2018-04-10 11:03:43 UTC

Description Paolo Bonzini 2017-12-12 17:46:36 UTC
A new kernel version can make new CPUID bits show up in KVM's capabilities.  So "uname -r" should be stored in the QEMU capabilities cache and checked at libvirt startup.

Comment 2 Jiri Denemark 2018-01-22 10:47:47 UTC
Patch sent upstream for review: https://www.redhat.com/archives/libvir-list/2018-January/msg00657.html

Comment 3 Jiri Denemark 2018-01-22 13:13:46 UTC
The patch is now pushed upstream as

commit 52b7d910b6b0ceeff50866774adba6efab55b2c0
Refs: v4.0.0-6-g52b7d910b6
Author:     Jiri Denemark <jdenemar>
AuthorDate: Mon Jan 22 11:37:04 2018 +0100
Commit:     Jiri Denemark <jdenemar>
CommitDate: Mon Jan 22 14:11:58 2018 +0100

    qemu: Refresh caps cache after booting a different kernel

    Whenever a different kernel is booted, some capabilities related to KVM
    (such as CPUID bits) may change. We need to refresh the cache to see the
    changes.

    Signed-off-by: Jiri Denemark <jdenemar>
    Reviewed-by: Daniel P. Berrange <berrange>

Comment 6 Luyao Huang 2018-01-24 02:37:48 UTC
Verify this bug with libvirt-3.9.0-9.el7.x86_64:

1. check caps file timestamp:

# ll /var/cache/libvirt/qemu/capabilities/3c76bc41d59c0c7314b1ae8e63f4f765d2cf16abaeea081b3ca1f5d8732f7bb1.xml 
-rw-------. 1 root root 51770 Jan 23 21:11 /var/cache/libvirt/qemu/capabilities/3c76bc41d59c0c7314b1ae8e63f4f765d2cf16abaeea081b3ca1f5d8732f7bb1.xml


2. check the kernel version in caps file:

# cat /var/cache/libvirt/qemu/capabilities/3c76bc41d59c0c7314b1ae8e63f4f765d2cf16abaeea081b3ca1f5d8732f7bb1.xml

...
  <kernelVersion>3.10.0-837.el7.x86_64 #1 SMP Tue Jan 23 13:31:59 UTC 2018</kernelVersion>
...

3. install a new kernel and reboot:

4. check the caps file timestamp:

# ll /var/cache/libvirt/qemu/capabilities/3c76bc41d59c0c7314b1ae8e63f4f765d2cf16abaeea081b3ca1f5d8732f7bb1.xml
-rw-------. 1 root root 51770 Jan 23 21:28 /var/cache/libvirt/qemu/capabilities/3c76bc41d59c0c7314b1ae8e63f4f765d2cf16abaeea081b3ca1f5d8732f7bb1.xml

5. check the kernel  version in caps file:

  <kernelVersion>3.10.0-831.el7.x86_64 #1 SMP Wed Jan 17 15:59:59 EST 2018</kernelVersion>

6. restart libvirtd and recheck the caps file timestamp:

# service libvirtd restart
Redirecting to /bin/systemctl restart libvirtd.service

# ll /var/cache/libvirt/qemu/capabilities/3c76bc41d59c0c7314b1ae8e63f4f765d2cf16abaeea081b3ca1f5d8732f7bb1.xml 
-rw-------. 1 root root 51770 Jan 23 21:28 /var/cache/libvirt/qemu/capabilities/3c76bc41d59c0c7314b1ae8e63f4f765d2cf16abaeea081b3ca1f5d8732f7bb1.xml

Comment 10 errata-xmlrpc 2018-04-10 11:02:08 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/RHEA-2018:0704


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