[libvirt] [PATCH 1/2] qemu: Force capabilities cache refresh if libvirtd date is different

Martin Kletzander mkletzan at redhat.com
Sat May 23 20:53:43 UTC 2015


On Sat, May 23, 2015 at 10:33:30AM -0400, John Ferlan wrote:
>https://bugzilla.redhat.com/show_bug.cgi?id=1195882
>
>Original commit id 'cbde3589' indicates that the cache file would be
>discarded if either the QEMU binary or libvirtd 'ctime' changes; however,
>the code only discarded if the QEMU binary time didn't match or if the
>new libvirtd ctime was later than what created the cache file.
>
>Since many factors come into play with 'ctime' adjustments (including
>perhaps turning back the hands of time), change the logic to also force
>a refresh if the ctime of libvirt is different than what's in the cache.
>
>Signed-off-by: John Ferlan <jferlan at redhat.com>
>---
> src/qemu/qemu_capabilities.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>

ACK

>diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
>index 375df22..a6fae38 100644
>--- a/src/qemu/qemu_capabilities.c
>+++ b/src/qemu/qemu_capabilities.c
>@@ -2981,9 +2981,9 @@ virQEMUCapsInitCached(virQEMUCapsPtr qemuCaps, const char *cacheDir)
>         goto cleanup;
>     }
>
>-    /* Discard if cache is older that QEMU binary */
>+    /* Discard cache if QEMU binary or libvirtd changed */
>     if (qemuctime != qemuCaps->ctime ||
>-        selfctime < virGetSelfLastChanged()) {
>+        selfctime != virGetSelfLastChanged()) {
>         VIR_DEBUG("Outdated cached capabilities '%s' for '%s' "
>                   "(%lld vs %lld, %lld vs %lld)",
>                   capsfile, qemuCaps->binary,
>--
>2.1.0
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150523/d430b839/attachment-0001.sig>


More information about the libvir-list mailing list