[libvirt PATCH v2] qemu: don't continue loading caps if outdated
Michal Privoznik
mprivozn at redhat.com
Tue Jun 23 12:41:26 UTC 2020
On 6/22/20 8:07 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 | 63 +++++++++++++++++++++++-------------
> src/qemu/qemu_capspriv.h | 6 ++--
> src/util/virfilecache.c | 11 ++++---
> src/util/virfilecache.h | 11 +++++--
> tests/testutilsqemu.c | 3 +-
> tests/virfilecachetest.c | 3 +-
> 6 files changed, 61 insertions(+), 36 deletions(-)
Reviewed-by: Michal Privoznik <mprivozn at redhat.com>
Michal
More information about the libvir-list
mailing list