Bug 1843534 - libvirt: Fix virConnectGetDomainCapabilities() call with empty cache [rhel-8.2.0.z]
Summary: libvirt: Fix virConnectGetDomainCapabilities() call with empty cache [rhel-8...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.2
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: 8.2
Assignee: Andrea Bolognani
QA Contact: Luyao Huang
URL:
Whiteboard:
Depends On: 1836351
Blocks: 1842869
TreeView+ depends on / blocked
 
Reported: 2020-06-03 13:41 UTC by Oneata Mircea Teodor
Modified: 2020-11-30 06:40 UTC (History)
15 users (show)

Fixed In Version: libvirt-6.0.0-17.3.el8
Doc Type: Bug Fix
Doc Text:
Cause: With version 6.0.0, libvirt started querying emulator capabilities lazily to improve startup time: this means that information about the default emulator for the host are only fetched if at least one of the defined VMs uses it. Consequence: If no VMs using it are defined, virConnectGetDomainCapabilities() fails because information about the default emulator for the host are not found in the cache. Fix: When virConnectGetDomainCapabilities() is called, information about the default emulator for the host are fetched unconditionally. Result: virConnectGetDomainCapabilities() succeeds and reports information about the default emulator for the host.
Clone Of: 1836351
Environment:
Last Closed: 2020-07-29 22:30:00 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:3234 0 None None None 2020-07-29 22:30:04 UTC

Comment 6 yalzhang@redhat.com 2020-06-08 09:42:59 UTC
reproduce this bug on libvirt-libs-6.0.0-17.2.module+el8.2.0+6629+3fc0f2c2.x86_64
1. make sure there is no guest and no cache file

# ll /var/cache/libvirt/qemu/
total 0

# virsh list --all
 Id   Name   State
--------------------

2. run domcapabilities command

# virsh domcapabilities
error: failed to get emulator capabilities
error: invalid argument: unable to find any emulator to serve 'x86_64' architecture

3. use virt-install to install an vm, then try above command:
# virsh domcapabilities 
<domainCapabilities>
  <path>/usr/libexec/qemu-kvm</path>
  <domain>kvm</domain>
...

4. update the libvirt to latest libvirt-libs-6.0.0-17.3.module+el8.2.0+6907+6abdb1b6.x86_64
# ll /var/cache/libvirt/qemu
total 0

# virsh list --all
 Id   Name   State
--------------------

# virsh domcapabilities 
<domainCapabilities>
  <path>/usr/libexec/qemu-kvm</path>
  <domain>kvm</domain>
  <machine>pc-i440fx-rhel7.6.0</machine>
  <arch>x86_64</arch>
...

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

Comment 8 errata-xmlrpc 2020-07-29 22:30:00 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/RHBA-2020:3234


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