{
size_t i;
- if (caps && virQEMUCapsGetArch(caps) != VIR_ARCH_NONE) {
+ if (virQEMUCapsGetArch(caps) != VIR_ARCH_NONE) {
/* all tests using real caps or arcitecture are expected to call:
*
* virFileCacheClear(driver.qemuCapsCache);
if (qemu_emulators[i] == NULL)
continue;
- if (caps)
- tmp = virQEMUCapsNewCopy(caps);
- else
- tmp = virQEMUCapsNew();
+ tmp = virQEMUCapsNewCopy(caps);
qemuTestCapsPopulateFakeMachines(tmp, i, hostOS);
virSecurityManager *mgr = NULL;
char statedir[] = STATEDIRTEMPLATE;
char configdir[] = CONFIGDIRTEMPLATE;
+ g_autoptr(virQEMUCaps) emptyCaps = NULL;
memset(driver, 0, sizeof(*driver));
if (!driver->xmlopt)
goto error;
- if (qemuTestCapsCacheInsert(driver->qemuCapsCache, NULL) < 0)
+ /* Populate the capabilities cache with fake empty caps */
+ emptyCaps = virQEMUCapsNew();
+ if (qemuTestCapsCacheInsert(driver->qemuCapsCache, emptyCaps) < 0)
goto error;
if (!(mgr = virSecurityManagerNew("none", "qemu",