if (!(priv->qemuCaps = qemuTestParseCapabilitiesArch(VIR_ARCH_X86_64, latestCapsFile)))
return -1;
+ virFileCacheClear(driver->qemuCapsCache);
+
if (qemuTestCapsCacheInsert(driver->qemuCapsCache, priv->qemuCaps) < 0)
return -1;
if (testQemuInfoInitArgs((struct testQemuInfo *) data) < 0)
return -1;
+ virFileCacheClear(driver.qemuCapsCache);
+
if (qemuTestCapsCacheInsert(driver.qemuCapsCache, data->qemuCaps) < 0)
return -1;
goto cleanup;
}
+ virFileCacheClear(driver.qemuCapsCache);
+
if (info->args.hostOS == HOST_OS_MACOS)
rc = qemuTestCapsCacheInsertMacOS(driver.qemuCapsCache, info->qemuCaps);
else
if (!(info->flags & FLAG_REAL_CAPS))
virQEMUCapsInitQMPBasicArch(info->qemuCaps);
+ virFileCacheClear(driver.qemuCapsCache);
+
if (info->args.hostOS == HOST_OS_MACOS)
rc = qemuTestCapsCacheInsertMacOS(driver.qemuCapsCache, info->qemuCaps);
else
size_t i;
if (caps && virQEMUCapsGetArch(caps) != VIR_ARCH_NONE) {
- /* for capabilities which have architecture set we populate only the
- * given architecture and poison all other so that the test doesn't
- * accidentally test a weird combination */
+ /* all tests using real caps or arcitecture are expected to call:
+ *
+ * virFileCacheClear(driver.qemuCapsCache);
+ *
+ * before populating the cache;
+ */
virArch arch = virQEMUCapsGetArch(caps);
- g_autoptr(virQEMUCaps) emptyCaps = virQEMUCapsNew();
g_autoptr(virQEMUCaps) copyCaps = NULL;
virQEMUCaps *effCaps = caps;
- if (!emptyCaps)
- return -1;
-
if (arch_alias[arch] != VIR_ARCH_NONE)
arch = arch_alias[arch];
if (qemuTestCapsCacheInsertData(cache, qemu_emulators[arch], effCaps) < 0)
return -1;
}
-
-
- for (i = 0; i < G_N_ELEMENTS(qemu_emulators); i++) {
- if (!qemu_emulators[i])
- continue;
-
- if (i == arch)
- continue;
-
- if (qemuTestCapsCacheInsertData(cache, qemu_emulators[i], emptyCaps) < 0)
- return -1;
- }
} else {
/* in case when caps are missing or are missing architecture, we populate
* everything */