From 390a1e2bfdfc3581d0290efce50a015e3fd8253d Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Tue, 10 Jan 2017 21:07:23 +0100 Subject: [PATCH] qemu: Fix CPU model fallback in domain capabilities Our documentation of the domain capabilities XML says that the fallback attribute of a CPU model is used to indicate whether the CPU model was detected by libvirt itself (fallback="allow") or by asking the hypervisor (fallback="forbid"). We need to properly set fallback="forbid" when CPU model comes from QEMU to match the documentation. Signed-off-by: Jiri Denemark --- src/qemu/qemu_capabilities.c | 3 +++ tests/domaincapsschemadata/qemu_2.8.0.s390x.xml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 0f5acb76a9..29ca3d4f90 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3105,6 +3105,9 @@ virQEMUCapsInitCPUModel(virQEMUCapsPtr qemuCaps, if (ARCH_IS_S390(qemuCaps->arch)) ret = virQEMUCapsInitCPUModelS390(qemuCaps, cpu); + if (ret == 0) + cpu->fallback = VIR_CPU_FALLBACK_FORBID; + return ret; } diff --git a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml index efe345962a..0b8135bc5c 100644 --- a/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml +++ b/tests/domaincapsschemadata/qemu_2.8.0.s390x.xml @@ -21,7 +21,7 @@ - zEC12.2-base + zEC12.2-base -- 2.39.5