From 1fd28a2e79692babd63d6b8e9eea90168dd0897e Mon Sep 17 00:00:00 2001 From: Jiri Denemark Date: Thu, 25 Jul 2019 10:27:45 +0200 Subject: [PATCH] qemu: Translate features in virQEMUCapsGetCPUFeatures Starting with QEMU 4.1 qemuMonitorCPUModelInfo structure in virQEMUCaps stores only canonical feature names which may differ from the name used by libvirt. We need translate these canonical names into libvirt names for further consumption. This fixes a bug in qemuConnectBaselineHypervisorCPU which would remove all features for which libvirt's spelling differs from the QEMU's preferred name. For example, the following result of qemuConnectBaselineHypervisorCPU on my host with QEMU 4.1 is wrong: Skylake-Client Intel The 'pclmuldq' and 'lahf_lm' should not be disabled in the baseline CPU as they are supported by QEMU on this host. Signed-off-by: Jiri Denemark Reviewed-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 65192469da..2388f145af 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2598,7 +2598,8 @@ virQEMUCapsGetCPUFeatures(virQEMUCapsPtr qemuCaps, if (migratable && prop->migratable == VIR_TRISTATE_BOOL_NO) continue; - if (VIR_STRDUP(list[n++], prop->name) < 0) + if (VIR_STRDUP(list[n++], + virQEMUCapsCPUFeatureFromQEMU(qemuCaps, prop->name)) < 0) goto cleanup; } -- 2.47.2