From nobody Sat Feb 7 09:40:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1729087380165412.389967203635; Wed, 16 Oct 2024 07:03:00 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 298511555; Wed, 16 Oct 2024 10:02:59 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id DC6451665; Wed, 16 Oct 2024 10:02:30 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 71163121F; Wed, 16 Oct 2024 10:02:27 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 8CB0CE8A for ; Wed, 16 Oct 2024 10:02:26 -0400 (EDT) Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-209-mJ8e1OcfP2mt3Pe51lxDug-1; Wed, 16 Oct 2024 10:02:23 -0400 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-37d59ad50f3so1939911f8f.0 for ; Wed, 16 Oct 2024 07:02:20 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d7fa9050csm4369535f8f.48.2024.10.16.07.02.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 07:02:17 -0700 (PDT) Received: from wheatley.brq.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 2C8D832AFF49 for ; Wed, 16 Oct 2024 16:02:16 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729087346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RZfUFP0pCGlp8jUGO+IOJDZonRZdqMbWMGArjJ3XdBk=; b=KJZ6SMuOtVQK5Zna0jQId5JkseOHCsvlSLQvNZCKOyIlipS7mwbvZavmQheePCf6dT8ul+ FS71iZP8qdu59h/9OFILdP8LmPlAi5BpMV7MdKlOM3OOWuOEJvOIfiwYDEyF78sKJZJ1Mk FSyltRBTxd/XVhxHneYaCgxMqsc8mZQ= X-MC-Unique: mJ8e1OcfP2mt3Pe51lxDug-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729087339; x=1729692139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RZfUFP0pCGlp8jUGO+IOJDZonRZdqMbWMGArjJ3XdBk=; b=M+kx38W9Vmq2NGUT8v3ym5oqmNF2hojnm0maF0hWynxlVb8FxD+fkGPckxSuvHFdhg 0Pp+fq8KYep5qnUzLH5/fuDfLdnFjP9vx4++8ygxYMpsdq9smgbVrCTbwMEF4Qtecp9J mVMdUUK+deJUs5GvB571zpSk3GqI2QXjQRyrv8I8Lc3qSbHQecPMnghmCRJ7j8uefs0r 5dYQuOel1iZ53xh343MIYW6PAb2O5+7Wn5+b4kG5TqRK7dua9aC5n1+/TeLWTn7a6BnL qdo2mkUNIUUOVcZnAm/G+DW3WNPF4jDdAXZ4NikJIaqDiwyRrPufWyP4/2lrZ1xcggHS cdpg== X-Gm-Message-State: AOJu0YxjpXLSflQcvOpQ2l/2I/Dl00yUKnhFJ/2msQYHjqlxSU5gP5fc OMLfQdbJrdIZLt1L5Eif8/0DE26Rw2PBg77bwlA0TrIALJup1xEYmUyYIKkQWcsGxL96JEhopfa YeOEPtWDAx3RjU9lP4mJxot1zrj2GhJCYFP0d3veqEmhhX5YUGJHS/suCO/Di7MwP1R2B13CfVA k6KU87nIqxj0AAQNqEfpStXLMDZonUE34OlOgRRNE= X-Received: by 2002:a5d:644f:0:b0:37d:5141:ee91 with SMTP id ffacd0b85a97d-37d86bba188mr2660394f8f.18.1729087339220; Wed, 16 Oct 2024 07:02:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHWaOgwooWHHb2ifZbtGsfVrD25cSfcGOfFjQaxOggGmhtWlDYE6k40nddK+KlWipv7wJnF1Q== X-Received: by 2002:a5d:644f:0:b0:37d:5141:ee91 with SMTP id ffacd0b85a97d-37d86bba188mr2660307f8f.18.1729087338139; Wed, 16 Oct 2024 07:02:18 -0700 (PDT) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH 1/2] qemu: Add more translations to virQEMUCapsCPUFeatureTranslationTable Date: Wed, 16 Oct 2024 16:02:09 +0200 Message-ID: <9f606c4f1f184f1c119ebb6d9301f6ef2bd9c63f.1729087292.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: 7UYXZ6LIA7FC23NILBMS6VT2ZNFU3ZUM X-Message-ID-Hash: 7UYXZ6LIA7FC23NILBMS6VT2ZNFU3ZUM X-MailFrom: mkletzan@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1729087381504116600 Content-Type: text/plain; charset="utf-8"; x-default="true" Hyper-V enlightenment features can have hyphenated names which libvirt exposes under Hyper-V features with underscored names. When libvirt checks that all requested features were enabled by QEMU (on x86 architectures) it first queries for all those that QEMU knows and compiles them in a map while using the virQEMUCapsCPUFeaturesX86 for translations. Some features (well, all Hyper-V features with underscores) were not present in the translation table and were incorrectly reported as not enabled, consequently failing the start of any such domain. Add all hyphenated/underscored Hyper-V feature names into the aforementioned translation table. That way domains with these features enabled can be started when QEMU and the kernel support them. Resolves: https://issues.redhat.com/browse/RHEL-7122 Signed-off-by: Martin Kletzander Reviewed-by: Jiri Denemark --- src/qemu/qemu_capabilities.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 7d0cb2caaa4a..e1e28e5cd1aa 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3583,6 +3583,9 @@ virQEMUCapsCPUFeatureTranslationTable virQEMUCapsCPUF= eaturesX86[] =3D { {"perfctr_nb", "perfctr-nb"}, {"tsc_adjust", "tsc-adjust"}, {"vmx-invvpid-single-context-noglobals", "vmx-invept-single-context-no= globals"}, + {"hv-vendor_id", "hv-vendor-id"}, + {"hv-emsr_bitmap", "hv-emsr-bitmap"}, + {"hv-xmm_input", "hv-xmm-input"}, {NULL, NULL} }; =20 --=20 2.47.0 From nobody Sat Feb 7 09:40:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 172908739803173.66100972697348; Wed, 16 Oct 2024 07:03:18 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id F308712FB; Wed, 16 Oct 2024 10:03:16 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 964701868; Wed, 16 Oct 2024 10:02:42 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id E8EF0143E; Wed, 16 Oct 2024 10:02:38 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 685BF1642 for ; Wed, 16 Oct 2024 10:02:30 -0400 (EDT) Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-453-xRBB62VMMRixJ_U2SpfQ5Q-1; Wed, 16 Oct 2024 10:02:26 -0400 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-37d56061a4cso2765878f8f.2 for ; Wed, 16 Oct 2024 07:02:20 -0700 (PDT) Received: from wheatley.localdomain (nat-pool-brq-t.redhat.com. [213.175.37.10]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d7fa7a151sm4350804f8f.10.2024.10.16.07.02.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Oct 2024 07:02:17 -0700 (PDT) Received: from wheatley.brq.redhat.com (wheatley.k8r.cz [127.0.0.1]) by wheatley.localdomain (Postfix) with ESMTP id 39DAD32AFF4A for ; Wed, 16 Oct 2024 16:02:16 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729087350; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Lgfv3NPSMQZ3e+4Qzfr2ffe+AkPaw96oWGHIcjY+fA8=; b=T/21gXEgo/vnUI7NhRm0gmgENfB2yA9yud11qFoGLw6nwu1kyNN0367ucDWmed+XzAhBCu AJoVt9ez05+O1ViY3p3LD5s2vrIqbxHvSH44v3HGd+XA+SI+izAe9/gYPi5AVA5Ygwctiz 4L2mlbvBDA/R5epacc2PwKERUtD1lJE= X-MC-Unique: xRBB62VMMRixJ_U2SpfQ5Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729087339; x=1729692139; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Lgfv3NPSMQZ3e+4Qzfr2ffe+AkPaw96oWGHIcjY+fA8=; b=Uead+7SOvqVYdOxSUwKHHDRPlY5RZ4ld8EAgjWbwqS12TJ4lHMxFKP+M5Ro3dJK78D fbmNeOvnCmesUq/dZj+QNnes9Bf6q3ESAYF5W9CrAiN+p2OekFJHEC2TAt+eJ/Ohgexf pOQIhoFKRPfG07DRWdnOMdxN02yWlN2vHyPajGW6uaZ+XzYDGMNoeGHkDImDt7trINAv DfDFLoesJmr8O0ZrZlcB7P5XacfhUJsXQnGxCcB0Pw5ort+iSE8pLPkCGJMHs9pyAWI+ xAx7iA/CHiqvmkqSs67ML5CHu6RPCihOtpSY3dxbkRK1eJ83kNDPzBrvZ141t7A/NTgm WcFQ== X-Gm-Message-State: AOJu0Ywttr/QWXARpTNFuxSoxFyqx1yeTCeG2MGGGjWFPnTFv0z/nCOi 2OTJaRuqm5Ely1alYXhhUujjqGGqfp6VVE8rtKQkIouUc9/39nHuZV/SlukAnGVs843IjM05pEY TrSfK/ZbTCH91uM5I4q9hvieWhGKKV8g+U8rY5Nj6nk6H7Jl5r8kEmQ1ogm4k1kBe2EGTOPcYkF 6fz/7ClE1Lj27NQB1Njxx0LOkQ/uhlOA5Asd20lTc= X-Received: by 2002:adf:f84e:0:b0:37d:3735:8fe9 with SMTP id ffacd0b85a97d-37d551d53cfmr13052061f8f.27.1729087338798; Wed, 16 Oct 2024 07:02:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGhWAGmEhLY9SV2Mwn0Ibr46RJKT/0nQUnY4vqwUV+zYx4vbxuxYKq64vUPMKg57+CmB0tS/A== X-Received: by 2002:adf:f84e:0:b0:37d:3735:8fe9 with SMTP id ffacd0b85a97d-37d551d53cfmr13051989f8f.27.1729087337801; Wed, 16 Oct 2024 07:02:17 -0700 (PDT) From: Martin Kletzander To: devel@lists.libvirt.org Subject: [PATCH 2/2] qemu: Do not hardcode Hyper-V feature names on command line Date: Wed, 16 Oct 2024 16:02:10 +0200 Message-ID: <771b6d855388c23b34f4acfbc408b4ebaef07285.1729087292.git.mkletzan@redhat.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: NK4HMQTIRJOB5ICAZS322FD5EGS45K4J X-Message-ID-Hash: NK4HMQTIRJOB5ICAZS322FD5EGS45K4J X-MailFrom: mkletzan@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1729087399553116600 Content-Type: text/plain; charset="utf-8"; x-default="true" When constructing the command line for QEMU, some Hyper-V features were hardcoded, probably due to the fact that they could not have been automatically translated from the libvirt feature name to QEMU CPU feature name. Well now they can be, thanks to their additions to the virQEMUCapsCPUFeaturesX86 translation table. Translate all such features the same way when constructing the command line. This way any future feature that is not translated will be caught by tests (if a test is added for it) which was not the case when it was just hardcoded. Hopefully this avoids at least some possible future issues. Signed-off-by: Martin Kletzander Reviewed-by: Jiri Denemark --- src/qemu/qemu_command.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index c7055ef196f0..a5ff7695c375 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -6315,9 +6315,15 @@ qemuBuildCpuCommandLine(virCommand *cmd, case VIR_DOMAIN_HYPERV_IPI: case VIR_DOMAIN_HYPERV_EVMCS: case VIR_DOMAIN_HYPERV_AVIC: - if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) - virBufferAsprintf(&buf, ",hv-%s=3Don", - virDomainHypervTypeToString(i)); + case VIR_DOMAIN_HYPERV_EMSR_BITMAP: + case VIR_DOMAIN_HYPERV_XMM_INPUT: + if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH_ON)= { + const char *name =3D virDomainHypervTypeToString(i); + g_autofree char *full_name =3D g_strdup_printf("hv-%s"= , name); + const char *qemu_name =3D virQEMUCapsCPUFeatureToQEMU(= def->os.arch, + fu= ll_name); + virBufferAsprintf(&buf, ",%s=3Don", qemu_name); + } if ((i =3D=3D VIR_DOMAIN_HYPERV_STIMER) && (def->hyperv_stimer_direct =3D=3D VIR_TRISTATE_SWITCH_= ON)) virBufferAsprintf(&buf, ",%s=3Don", VIR_CPU_x86_HV_STI= MER_DIRECT); @@ -6336,16 +6342,6 @@ qemuBuildCpuCommandLine(virCommand *cmd, def->hyperv_vendor_id); break; =20 - case VIR_DOMAIN_HYPERV_EMSR_BITMAP: - if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) - virBufferAsprintf(&buf, ",%s=3Don", "hv-emsr-bitmap"); - break; - - case VIR_DOMAIN_HYPERV_XMM_INPUT: - if (def->hyperv_features[i] =3D=3D VIR_TRISTATE_SWITCH_ON) - virBufferAsprintf(&buf, ",%s=3Don", "hv-xmm-input"); - break; - case VIR_DOMAIN_HYPERV_LAST: break; } --=20 2.47.0