mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 05:17:59 +03:00
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: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
53fa2edb62
commit
7de761a67b
@ -486,16 +486,13 @@ qemuTestSetHostCPU(virCapsPtr caps,
|
||||
|
||||
|
||||
virQEMUCapsPtr
|
||||
qemuTestParseCapabilities(virCapsPtr caps,
|
||||
const char *capsFile)
|
||||
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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user