Bug 1807198 - Domain capabilities are not updated between virsh calls
Summary: Domain capabilities are not updated between virsh calls
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 32
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1861280
TreeView+ depends on / blocked
 
Reported: 2020-02-25 19:12 UTC by Matej Marušák
Modified: 2021-05-25 15:44 UTC (History)
11 users (show)

Fixed In Version:
Clone Of:
: 1861280 (view as bug list)
Environment:
Last Closed: 2021-05-25 15:44:10 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Matej Marušák 2020-02-25 19:12:41 UTC
On the new Fedora 32 domain capabilities do not get updated dynamically as it is happening on Fedora 31. Workaround I found is to restart libvirtd service.

Version-Release number of selected component (if applicable):
libvirt-client-6.0.0-1.fc32.x86_64

How reproducible:
1. Notice that value points to to `/usr/share/edk2/ovmf/OVMF_CODE.fd`
```
# virsh domcapabilities
<domainCapabilities>
...snip...
  <os supported='yes'>
    <enum name='firmware'>
      <value>efi</value>
    </enum>
    <loader supported='yes'>
      <value>/usr/share/edk2/ovmf/OVMF_CODE.fd</value>
      <enum name='type'>
...snip...
```
2. `rm -rf /usr/share/edk2/*`
3. Observe that it still points to the path, even though it does not exist.
```
# virsh domcapabilities
<domainCapabilities>
...snip...
  <os supported='yes'>
    <enum name='firmware'>
      <value>efi</value>
    </enum>
    <loader supported='yes'>
      <value>/usr/share/edk2/ovmf/OVMF_CODE.fd</value>
      <enum name='type'>
...snip...
```
4. `systemctl restart libvirtd`
5.  After restarting the service the value is now updated.
```
#  virsh domcapabilities
<domainCapabilities>
...snip...
    <enum name='firmware'>
      <value>efi</value>
    </enum>
    <loader supported='yes'>
      <enum name='type'>
        <value>rom</value>
        <value>pflash</value>
...snip...
```

Expected results:
I would expect that the values would be updated even without restarting of the service. It works like that on Fedora 31.

Comment 1 Michal Privoznik 2020-11-10 15:59:11 UTC
I think this is the result of libvirt's internal domcapabilities caching which was introduced in 5.7.0 release. The domcapabilites were viewed as immutable and thus the cache has no invalidation mechanism.

Comment 2 Michal Privoznik 2020-11-16 07:44:55 UTC
Patches posted upstream:

https://www.redhat.com/archives/libvir-list/2020-November/msg00792.html

Comment 3 Michal Privoznik 2020-11-16 17:29:03 UTC
Pushed upstream:

19c4c6f8fd qemu: Remove virQEMUDomainCapsCache code
7db61843b0 qemu: Don't cache domCaps in virQEMUDriverGetDomainCapabilities()
4b487e1052 conf: Drop virDomainCapsDeviceDefValidate()
a33279daa8 qemu: Validate video model
5216304bfe qemu: Validate RNG model

v6.9.0-287-g19c4c6f8fd

Comment 4 Michal Privoznik 2020-11-17 11:29:23 UTC
There are follow up patches:

https://www.redhat.com/archives/libvir-list/2020-November/msg00905.html

Comment 5 Michal Privoznik 2020-11-18 09:06:12 UTC
And I just merged the follow up patches:

318658b36b qemu_validate: Deduplicate code for graphics type check
919ff9debf domcaps: Report egl-headless graphics type
5ea08a33bf qemu_validate: Deduplicate code for RNG model check
d009f5b400 qemu_validate: Deduplicate code for video model check
4f8677cee2 domain_capabilities: Introduce VIR_DOMAIN_CAPS_ENUM_IS_SET

v6.9.0-304-g318658b36b

Comment 6 Fedora Program Management 2021-04-29 16:13:06 UTC
This message is a reminder that Fedora 32 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 32 on 2021-05-25.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '32'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 32 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 Ben Cotton 2021-05-25 15:44:10 UTC
Fedora 32 changed to end-of-life (EOL) status on 2021-05-25. Fedora 32 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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