提交 7de761a6 编写于 作者: P Peter Krempa

tests: utils: Allow parsing test capability file without virCaps

virCaps was used only to propagate the host architecture, so the
function can be extracted in a way which does not require it.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
上级 53fa2edb
......@@ -486,16 +486,13 @@ qemuTestSetHostCPU(virCapsPtr caps,
virQEMUCapsPtr
qemuTestParseCapabilities(virCapsPtr caps,
qemuTestParseCapabilitiesArch(virArch arch,
const char *capsFile)
{
virQEMUCapsPtr qemuCaps = NULL;
if (!caps)
return NULL;
if (!(qemuCaps = virQEMUCapsNew()) ||
virQEMUCapsLoadCache(caps->host.arch, qemuCaps, capsFile) < 0)
virQEMUCapsLoadCache(arch, qemuCaps, capsFile) < 0)
goto error;
return qemuCaps;
......@@ -505,6 +502,18 @@ qemuTestParseCapabilities(virCapsPtr caps,
return NULL;
}
virQEMUCapsPtr
qemuTestParseCapabilities(virCapsPtr caps,
const char *capsFile)
{
if (!caps)
return NULL;
return qemuTestParseCapabilitiesArch(caps->host.arch, capsFile);
}
void qemuTestDriverFree(virQEMUDriver *driver)
{
virMutexDestroy(&driver->lock);
......
......@@ -16,6 +16,9 @@ enum {
virCapsPtr testQemuCapsInit(void);
virDomainXMLOptionPtr testQemuXMLConfInit(void);
virQEMUCapsPtr qemuTestParseCapabilitiesArch(virArch arch,
const char *capsFile);
virQEMUCapsPtr qemuTestParseCapabilities(virCapsPtr caps,
const char *capsFile);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册