virQEMUCapsLoadCache(virCapsPtr caps,
virQEMUCapsPtr qemuCaps,
const char *filename,
- time_t *qemuctime,
time_t *selfctime,
unsigned long *selfvers)
{
_("missing qemuctime in QEMU capabilities XML"));
goto cleanup;
}
- *qemuctime = (time_t)l;
+ qemuCaps->ctime = (time_t)l;
if (virXPathLongLong("string(./selfctime)", ctxt, &l) < 0) {
virReportError(VIR_ERR_XML_ERROR, "%s",
int ret = -1;
char *binaryhash = NULL;
struct stat sb;
- time_t qemuctime;
+ time_t qemuctime = qemuCaps->ctime;
time_t selfctime;
unsigned long selfvers;
}
if (virQEMUCapsLoadCache(caps, qemuCaps, capsfile,
- &qemuctime, &selfctime, &selfvers) < 0) {
+ &selfctime, &selfvers) < 0) {
VIR_WARN("Failed to load cached caps from '%s' for '%s': %s",
capsfile, qemuCaps->binary, virGetLastErrorMessage());
virResetLastError();
VIR_DEBUG("Outdated cached capabilities '%s' for '%s' "
"(%lld vs %lld, %lld vs %lld, %lu vs %lu)",
capsfile, qemuCaps->binary,
- (long long)qemuctime, (long long)qemuCaps->ctime,
+ (long long)qemuCaps->ctime, (long long)qemuctime,
(long long)selfctime, (long long)virGetSelfLastChanged(),
selfvers, (unsigned long)LIBVIR_VERSION_NUMBER);
ignore_value(unlink(capsfile));
ret = 1;
cleanup:
+ qemuCaps->ctime = qemuctime;
VIR_FREE(binaryhash);
VIR_FREE(capsfile);
VIR_FREE(capsdir);
const char *capsFile)
{
virQEMUCapsPtr qemuCaps = NULL;
- time_t qemuctime;
time_t selfctime;
unsigned long version;
if (!(qemuCaps = virQEMUCapsNew()) ||
virQEMUCapsLoadCache(caps, qemuCaps, capsFile,
- &qemuctime, &selfctime, &version) < 0)
+ &selfctime, &version) < 0)
goto error;
return qemuCaps;