On Mon, Jun 22, 2020 at 05:30:39PM +0200, Michal Privoznik wrote:
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(a)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.
Doh, I missed that.
We should fix the XML to be complete, and provide then mock the
check so it always succeeds.
Regards,
Daniel
--
|:
https://berrange.com -o-
https://www.flickr.com/photos/dberrange :|
|:
https://libvirt.org -o-
https://fstop138.berrange.com :|
|:
https://entangle-photo.org -o-
https://www.instagram.com/dberrange :|