]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Don't cache domCaps in virQEMUDriverGetDomainCapabilities()
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 13 Nov 2020 20:09:33 +0000 (21:09 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 16 Nov 2020 17:26:50 +0000 (18:26 +0100)
commit7db61843b05a6e4295b1d2e27a3d86f162ef04a0
treed0623e52383644367d5cb80c8556077fa101fa6f
parent4b487e10523ab12c4189562c4605db13c1189e9c
qemu: Don't cache domCaps in virQEMUDriverGetDomainCapabilities()

Currently, whenever a domain capabilities is needed (fortunately,
after cleanup done by previous commits it is now only in
virConnectGetDomainCapabilities()), the object is stored in a
cache. But there is no invalidation mechanism for the cache
(except the implicit one - the cache is part of qemuCaps and thus
share its lifetime, but that is not enough). Therefore, if
something changes - for instance new firmware files are
installed, or old are removed these changes are not reflected in
the virConnectGetDomainCapabilities() output.

Originally, the caching was there because domCaps were used
during device XML validation and they were used a lot from our
test suite. But this is no longer the case. And therefore, we
don't need the cache and can construct fresh domCaps on each
virConnectGetDomainCapabilities() call.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1807198

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
src/qemu/qemu_conf.c