mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
tests: use mockup cache
Use the new API in order to correctly add capability sets to the cache before parsing XML files Signed-off-by: Pavel Fedin <p.fedin@samsung.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
@@ -559,6 +559,8 @@ int qemuTestCapsCacheInsert(virQEMUCapsCachePtr cache, const char *binary,
|
||||
ret = virHashAddEntry(cache->binaries, binary, caps);
|
||||
if (ret < 0)
|
||||
virObjectUnref(caps);
|
||||
else
|
||||
qemuTestCapsName = binary;
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -573,10 +575,19 @@ int qemuTestDriverInit(virQEMUDriver *driver)
|
||||
if (!driver->caps)
|
||||
goto error;
|
||||
|
||||
/* Using /dev/null for libDir and cacheDir automatically produces errors
|
||||
* upon attempt to use any of them */
|
||||
driver->qemuCapsCache = virQEMUCapsCacheNew("/dev/null", "/dev/null", 0, 0);
|
||||
if (!driver->qemuCapsCache)
|
||||
goto error;
|
||||
|
||||
driver->xmlopt = virQEMUDriverCreateXMLConf(driver);
|
||||
if (!driver->xmlopt)
|
||||
goto error;
|
||||
|
||||
if (qemuTestCapsCacheInsert(driver->qemuCapsCache, "empty", NULL) < 0)
|
||||
goto error;
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
|
||||
Reference in New Issue
Block a user