From f2962c42448d442414246715a30ae74c8dc9fef3 Mon Sep 17 00:00:00 2001 Message-Id: From: Jiri Denemark Date: Thu, 27 Feb 2020 15:23:04 +0100 Subject: [PATCH] qemu: Translate features in virQEMUCapsGetCPUFeatures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 (cherry picked from commit 1fd28a2e79692babd63d6b8e9eea90168dd0897e) https://bugzilla.redhat.com/show_bug.cgi?id=1804224 https://bugzilla.redhat.com/show_bug.cgi?id=1809510 Signed-off-by: Jiri Denemark Message-Id: Reviewed-by: Ján Tomko --- 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 c25d8c3e1a..a7cc324105 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -2521,7 +2521,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.25.1