提交 b89fa6d1 编写于 作者: J Jiri Denemark

qemuxml2argvtest: Properly setup CPU models in qemuCaps

Adding x86 CPU models into a list of supported CPUs for non-x86
architectures is not a very good idea. Each architecture we test needs
to maintain its own list of supported CPU models.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 e9634933
......@@ -8,7 +8,7 @@ QEMU_AUDIO_DRV=none \
-name QEMUGuest1 \
-S \
-M pseries \
-cpu POWER7_v2.3 \
-cpu POWER7 \
-m 512 \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid 1ccfd97d-5eb4-478a-bbe6-88d254c16db7 \
......
......@@ -7,7 +7,7 @@
<type arch='ppc64' machine='pseries'>hvm</type>
</os>
<cpu match='exact'>
<model>POWER7_v2.3</model>
<model>POWER7</model>
<vendor>IBM</vendor>
</cpu>
<clock offset='utc'/>
......
......@@ -283,27 +283,42 @@ struct testInfo {
static int
testAddCPUModels(virQEMUCapsPtr caps, bool skipLegacy)
{
const char *newModels[] = {
virArch arch = virQEMUCapsGetArch(caps);
const char *x86Models[] = {
"Opteron_G3", "Opteron_G2", "Opteron_G1",
"Nehalem", "Penryn", "Conroe",
"Haswell-noTSX", "Haswell",
};
const char *legacyModels[] = {
const char *x86LegacyModels[] = {
"n270", "athlon", "pentium3", "pentium2", "pentium",
"486", "coreduo", "kvm32", "qemu32", "kvm64",
"core2duo", "phenom", "qemu64",
};
const char *armModels[] = {
"cortex-a9", "cortex-a8", "cortex-a57", "cortex-a53",
};
const char *ppc64Models[] = {
"POWER8", "POWER7",
};
if (virQEMUCapsAddCPUDefinitions(caps, newModels,
ARRAY_CARDINALITY(newModels)) < 0)
return -1;
if (skipLegacy)
return 0;
if (virQEMUCapsAddCPUDefinitions(caps, legacyModels,
ARRAY_CARDINALITY(legacyModels)) < 0)
return -1;
if (ARCH_IS_X86(arch)) {
if (virQEMUCapsAddCPUDefinitions(caps, x86Models,
ARRAY_CARDINALITY(x86Models)) < 0)
return -1;
if (!skipLegacy &&
virQEMUCapsAddCPUDefinitions(caps, x86LegacyModels,
ARRAY_CARDINALITY(x86LegacyModels)) < 0)
return -1;
} else if (ARCH_IS_ARM(arch)) {
if (virQEMUCapsAddCPUDefinitions(caps, armModels,
ARRAY_CARDINALITY(armModels)) < 0)
return -1;
} else if (ARCH_IS_PPC64(arch)) {
if (virQEMUCapsAddCPUDefinitions(caps, ppc64Models,
ARRAY_CARDINALITY(ppc64Models)) < 0)
return -1;
}
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册