[libvirt PATCH] qemu: don't continue loading caps if outdated

Michal Privoznik mprivozn at redhat.com
Mon Jun 22 15:30:39 UTC 2020


On 6/18/20 4:31 PM, Daniel P. Berrangé wrote:
> The XML format used for QEMU capabilities is not required to be
> stable across releases, as we invalidate the cache whenever the
> libvirt binary changes.
> 
> We none the less always try to parse te entire XML file before
> we do any validity checks. Thus if we change the format of any
> part of the data, or change permitted values for enums, then
> libvirtd logs will be spammed with errors.
> 
> These are not in fact errors, but an expected scenario.
> 
> This change makes the loading code validate the cache timestamp
> against the libvirtd timestamp immediately. If they don't match
> then we stop loading the rest of the XML file.
> 
> Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
> ---
>   src/qemu/qemu_capabilities.c | 48 ++++++++++++++++++++++++++----------
>   src/util/virfilecache.c      | 11 ++++++---
>   src/util/virfilecache.h      | 11 ++++++---
>   tests/virfilecachetest.c     |  3 ++-
>   4 files changed, 52 insertions(+), 21 deletions(-)
> 

While I agree with the idea, we need to think of tests.
The problem is that in tests/ we store some capabilities which don't 
have <selfvers/> and thus many of our tests fail to load them.

Michal




More information about the libvir-list mailing list