[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 06/11] qemu: move libvirt ctime and version check into virQEMUCapsIsValid



On Mon, Jul 10, 2017 at 14:46:45 +0200, Pavel Hrdina wrote:
> Signed-off-by: Pavel Hrdina <phrdina redhat com>
> ---
>  src/qemu/qemu_capabilities.c | 25 ++++++++++++-------------
>  1 file changed, 12 insertions(+), 13 deletions(-)
> 
> diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
> index 8a2a73dc5b..4d8890aaaf 100644
> --- a/src/qemu/qemu_capabilities.c
> +++ b/src/qemu/qemu_capabilities.c
> @@ -4293,6 +4293,18 @@ virQEMUCapsIsValid(virQEMUCapsPtr qemuCaps,
>      if (!qemuCaps->binary)
>          return true;
>  
> +    if (qemuCaps->libvirtCtime != virGetSelfLastChanged() ||
> +        qemuCaps->libvirtVersion != LIBVIR_VERSION_NUMBER) {
> +        VIR_DEBUG("Outdated capabilities for '%s': libvirt changed "
> +                  "(%lld vs %lld, %lu vs %lu)",
> +                  qemuCaps->binary,
> +                  (long long)qemuCaps->libvirtCtime,
> +                  (long long)virGetSelfLastChanged(),
> +                  (unsigned long)qemuCaps->libvirtVersion,
> +                  (unsigned long)LIBVIR_VERSION_NUMBER);
> +        return false;
> +    }
> +

This change causes libvirt's ctime to be compared everytime the cache is
looked up (in virQEMUCapsCacheValidate). This looked fishy, but
virGetSelfLastChanged returns cached ctime fetched only once when
libvirtd starts.

Reviewed-by: Jiri Denemark <jdenemar redhat com>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]