mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: don't pass qemuctime into virQEMUCapsIsValid
It's not required and following patches will change the code. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
7fcf66cf63
commit
56a047a67e
@ -4283,11 +4283,11 @@ virQEMUCapsReset(virQEMUCapsPtr qemuCaps)
|
|||||||
|
|
||||||
static bool
|
static bool
|
||||||
virQEMUCapsIsValid(virQEMUCapsPtr qemuCaps,
|
virQEMUCapsIsValid(virQEMUCapsPtr qemuCaps,
|
||||||
time_t qemuctime,
|
|
||||||
uid_t runUid,
|
uid_t runUid,
|
||||||
gid_t runGid)
|
gid_t runGid)
|
||||||
{
|
{
|
||||||
bool kvmUsable;
|
bool kvmUsable;
|
||||||
|
struct stat sb;
|
||||||
|
|
||||||
if (!qemuCaps->binary)
|
if (!qemuCaps->binary)
|
||||||
return true;
|
return true;
|
||||||
@ -4304,24 +4304,19 @@ virQEMUCapsIsValid(virQEMUCapsPtr qemuCaps,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!qemuctime) {
|
if (stat(qemuCaps->binary, &sb) < 0) {
|
||||||
struct stat sb;
|
char ebuf[1024];
|
||||||
|
VIR_DEBUG("Failed to stat QEMU binary '%s': %s",
|
||||||
if (stat(qemuCaps->binary, &sb) < 0) {
|
qemuCaps->binary,
|
||||||
char ebuf[1024];
|
virStrerror(errno, ebuf, sizeof(ebuf)));
|
||||||
VIR_DEBUG("Failed to stat QEMU binary '%s': %s",
|
return false;
|
||||||
qemuCaps->binary,
|
|
||||||
virStrerror(errno, ebuf, sizeof(ebuf)));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
qemuctime = sb.st_ctime;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qemuctime != qemuCaps->ctime) {
|
if (sb.st_ctime != qemuCaps->ctime) {
|
||||||
VIR_DEBUG("Outdated capabilities for '%s': QEMU binary changed "
|
VIR_DEBUG("Outdated capabilities for '%s': QEMU binary changed "
|
||||||
"(%lld vs %lld)",
|
"(%lld vs %lld)",
|
||||||
qemuCaps->binary,
|
qemuCaps->binary,
|
||||||
(long long) qemuctime, (long long) qemuCaps->ctime);
|
(long long) sb.st_ctime, (long long) qemuCaps->ctime);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4401,7 +4396,7 @@ virQEMUCapsInitCached(virCapsPtr caps,
|
|||||||
goto discard;
|
goto discard;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!virQEMUCapsIsValid(qemuCaps, qemuctime, runUid, runGid))
|
if (!virQEMUCapsIsValid(qemuCaps, runUid, runGid))
|
||||||
goto discard;
|
goto discard;
|
||||||
|
|
||||||
VIR_DEBUG("Loaded '%s' for '%s' ctime %lld usedQMP=%d",
|
VIR_DEBUG("Loaded '%s' for '%s' ctime %lld usedQMP=%d",
|
||||||
@ -5411,7 +5406,7 @@ virQEMUCapsCacheValidate(virQEMUCapsCachePtr cache,
|
|||||||
virQEMUCapsPtr *qemuCaps)
|
virQEMUCapsPtr *qemuCaps)
|
||||||
{
|
{
|
||||||
if (*qemuCaps &&
|
if (*qemuCaps &&
|
||||||
!virQEMUCapsIsValid(*qemuCaps, 0, cache->runUid, cache->runGid)) {
|
!virQEMUCapsIsValid(*qemuCaps, cache->runUid, cache->runGid)) {
|
||||||
VIR_DEBUG("Cached capabilities %p no longer valid for %s",
|
VIR_DEBUG("Cached capabilities %p no longer valid for %s",
|
||||||
*qemuCaps, binary);
|
*qemuCaps, binary);
|
||||||
virHashRemoveEntry(cache->binaries, binary);
|
virHashRemoveEntry(cache->binaries, binary);
|
||||||
|
Loading…
Reference in New Issue
Block a user