mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
qemu: move libvirt ctime and version check into virQEMUCapsIsValid
Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
f2dd7259b4
commit
7fcf66cf63
@ -4292,6 +4292,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;
|
||||
|
||||
@ -4392,19 +4404,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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user