Signed-off-by: Jiri Denemark <jdenemar@xxxxxxxxxx> --- Notes: Version 2: - new patch (separated from patch 10/41) tests/testutilsqemu.c | 16 +++++++++++++++- tests/testutilsqemu.h | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c index b569e0d..f59746a 100644 --- a/tests/testutilsqemu.c +++ b/tests/testutilsqemu.c @@ -16,6 +16,7 @@ virCPUDefPtr cpuDefault; virCPUDefPtr cpuHaswell; +virCPUDefPtr cpuPower8; static virCPUFeatureDef cpuDefaultFeatures[] = { { (char *) "lahf_lm", -1 }, @@ -92,6 +93,15 @@ static virCPUDef cpuHaswellData = { cpuHaswellFeatures, /* features */ }; +static virCPUDef cpuPower8Data = { + .type = VIR_CPU_TYPE_HOST, + .arch = VIR_ARCH_PPC64, + .model = (char *) "POWER8", + .sockets = 1, + .cores = 8, + .threads = 8, +}; + static virCapsGuestMachinePtr *testQemuAllocMachines(int *nmachines) { virCapsGuestMachinePtr *machines; @@ -331,7 +341,8 @@ virCapsPtr testQemuCapsInit(void) goto cleanup; if (!(cpuDefault = virCPUDefCopy(&cpuDefaultData)) || - !(cpuHaswell = virCPUDefCopy(&cpuHaswellData))) + !(cpuHaswell = virCPUDefCopy(&cpuHaswellData)) || + !(cpuPower8 = virCPUDefCopy(&cpuPower8Data))) goto cleanup; qemuTestSetHostCPU(caps, NULL); @@ -443,6 +454,7 @@ virCapsPtr testQemuCapsInit(void) caps->host.cpu = NULL; virCPUDefFree(cpuDefault); virCPUDefFree(cpuHaswell); + virCPUDefFree(cpuPower8); virObjectUnref(caps); return NULL; } @@ -468,6 +480,8 @@ qemuTestSetHostCPU(virCapsPtr caps, if (!cpu) { if (ARCH_IS_X86(arch)) cpu = cpuDefault; + else if (ARCH_IS_PPC64(arch)) + cpu = cpuPower8; } if (cpu) diff --git a/tests/testutilsqemu.h b/tests/testutilsqemu.h index 7c678c9..6d35116f 100644 --- a/tests/testutilsqemu.h +++ b/tests/testutilsqemu.h @@ -19,6 +19,7 @@ virQEMUCapsPtr qemuTestParseCapabilities(const char *capsFile); extern virCPUDefPtr cpuDefault; extern virCPUDefPtr cpuHaswell; +extern virCPUDefPtr cpuPower8; void qemuTestSetHostArch(virCapsPtr caps, virArch arch); -- 2.10.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list