Debian's package manager will preserve mtime timestamp on binaries
from the time they are built, rather than installed. So if a
user downgrades their QEMU dpkg, the libvirt capabilities
cache will not refresh. The fix is to use ctime instead of mtime
since it cannot be faked.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
bool usedQMP;
char *binary;
- time_t mtime;
+ time_t ctime;
virBitmapPtr flags;
binary);
goto error;
}
- qemuCaps->mtime = sb.st_mtime;
+ qemuCaps->ctime = sb.st_ctime;
/* Make sure the binary we are about to try exec'ing exists.
* Technically we could catch the exec() failure, but that's
if (stat(qemuCaps->binary, &sb) < 0)
return false;
- return sb.st_mtime == qemuCaps->mtime;
+ return sb.st_ctime == qemuCaps->ctime;
}