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

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

 



Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
---
 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;
+    }
+
     if (!qemuctime) {
         struct stat sb;
 
@@ -4393,19 +4405,6 @@ virQEMUCapsInitCached(virCapsPtr caps,
     if (!virQEMUCapsIsValid(qemuCaps, qemuctime, runUid, runGid))
         goto discard;
 
-    /* Discard cache if QEMU binary or libvirtd changed */
-    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);
-        goto discard;
-    }
-
     VIR_DEBUG("Loaded '%s' for '%s' ctime %lld usedQMP=%d",
               capsfile, qemuCaps->binary,
               (long long)qemuCaps->ctime, qemuCaps->usedQMP);
-- 
2.13.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux