tests: qemuxml2argv s390x cpu model

Test cases for qemu s390x cpu model argument generation.

Signed-off-by: Jason J. Herne <jjherne@linux.vnet.ibm.com>
This commit is contained in:
Jason J. Herne 2016-12-18 14:22:28 -05:00 committed by Jiri Denemark
parent 5d513d4659
commit 27e411fa83
3 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,19 @@
LC_ALL=C \
PATH=/bin \
HOME=/home/test \
USER=test \
LOGNAME=test \
QEMU_AUDIO_DRV=none \
/usr/bin/qemu-kvm \
-name guest1 \
-S \
-M s390-ccw-virtio \
-cpu zEC12 \
-m 214 \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-nographic \
-nodefaults \
-monitor unix:/tmp/lib/domain--1-guest1/monitor.sock,server,nowait \
-no-acpi \
-boot c

View File

@ -0,0 +1,21 @@
<domain type='kvm'>
<name>guest1</name>
<uuid>c7a5fdbd-edaf-9455-926a-d65c16db1809</uuid>
<memory unit='KiB'>219100</memory>
<currentMemory unit='KiB'>219100</currentMemory>
<vcpu placement='static'>1</vcpu>
<os>
<type arch='s390x' machine='s390-ccw-virtio'>hvm</type>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<cpu mode='custom' match='exact'>
<model fallback='forbid'>zEC12</model>
</cpu>
<devices>
<emulator>/usr/bin/qemu-kvm</emulator>
<memballoon model='none'/>
</devices>
</domain>

View File

@ -300,6 +300,9 @@ testAddCPUModels(virQEMUCapsPtr caps, bool skipLegacy)
const char *ppc64Models[] = {
"POWER8", "POWER7",
};
const char *s390xModels[] = {
"z990", "zEC12", "z13",
};
if (ARCH_IS_X86(arch)) {
if (virQEMUCapsAddCPUDefinitions(caps, VIR_DOMAIN_VIRT_KVM, x86Models,
@ -337,6 +340,11 @@ testAddCPUModels(virQEMUCapsPtr caps, bool skipLegacy)
ARRAY_CARDINALITY(ppc64Models),
VIR_DOMCAPS_CPU_USABLE_UNKNOWN) < 0)
return -1;
} else if (ARCH_IS_S390(arch)) {
if (virQEMUCapsAddCPUDefinitions(caps, VIR_DOMAIN_VIRT_KVM, s390xModels,
ARRAY_CARDINALITY(s390xModels),
VIR_DOMCAPS_CPU_USABLE_UNKNOWN) < 0)
return -1;
}
return 0;
@ -1520,6 +1528,10 @@ mymain(void)
DO_TEST_FAILURE("cpu-host-passthrough", NONE);
DO_TEST_FAILURE("cpu-qemu-host-passthrough", QEMU_CAPS_KVM);
qemuTestSetHostArch(driver.caps, VIR_ARCH_S390X);
DO_TEST("cpu-s390-zEC12", QEMU_CAPS_KVM, QEMU_CAPS_VIRTIO_CCW, QEMU_CAPS_VIRTIO_S390);
qemuTestSetHostArch(driver.caps, VIR_ARCH_NONE);
qemuTestSetHostCPU(driver.caps, cpuHaswell);
DO_TEST("cpu-Haswell", QEMU_CAPS_KVM);
DO_TEST("cpu-Haswell2", QEMU_CAPS_KVM);