qemu: use NUMA capabilities object directly

Avoid grabbing the whole virCapsPtr object when we only need the
NUMA information.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Daniel P. Berrangé
2019-11-29 10:40:39 +00:00
parent 6cc992bd1a
commit 1a1d848694
6 changed files with 57 additions and 41 deletions

View File

@@ -109,6 +109,18 @@ virFindFileInPath(const char *file)
return NULL;
}
virCapsHostNUMAPtr
virCapabilitiesHostNUMANewHost(void)
{
/*
* Build a NUMA topology with cell_id (NUMA node id
* being 3(0 + 3),4(1 + 3), 5 and 6
*/
return virTestCapsBuildNUMATopology(3);
}
static int
testQemuAddGuest(virCapsPtr caps,
virArch arch)
@@ -201,11 +213,7 @@ virCapsPtr testQemuCapsInit(void)
qemuTestSetHostCPU(caps, NULL);
/*
* Build a NUMA topology with cell_id (NUMA node id
* being 3(0 + 3),4(1 + 3), 5 and 6
*/
if (!(caps->host.numa = virTestCapsBuildNUMATopology(3)))
if (!(caps->host.numa = virCapabilitiesHostNUMANewHost()))
goto cleanup;
for (i = 0; i < VIR_ARCH_LAST; i++) {