qemu: check for model-expansion cap before baselining

Hypervisor-cpu-baseline requires the cpu-model-expansion
capability when expanding CPU model features if the
--features flag is provided.

Signed-off-by: Collin Walling <walling@linux.ibm.com>
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Collin Walling 2020-09-24 20:22:35 -04:00 committed by Jiri Denemark
parent b19863640d
commit c003041034

View File

@ -12526,7 +12526,8 @@ qemuConnectBaselineHypervisorCPU(virConnectPtr conn,
(const char **)features, migratable)))
goto cleanup;
} else if (ARCH_IS_S390(arch) &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_BASELINE)) {
virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_BASELINE) &&
virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION)) {
bool expand_features = (flags & VIR_CONNECT_BASELINE_CPU_EXPAND_FEATURES);
if (!(cpu = qemuConnectCPUModelBaseline(qemuCaps, cfg->libDir,