From nobody Fri Nov 21 10:11:43 2025 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=pass; 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=pass(p=reject dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1763678427; cv=none; d=zohomail.com; s=zohoarc; b=P9LsKMASlNRh0CUdsqN7YxD2KgqZd49q6wq4edM7T6//5DwwS1BcOfmQ9e5JN4s36U0Zw0PUaMMEhGUkNu7qn/G4qGA2gGhHgqkI81kDICIi1islFQDvwEf4QF52mdseSl1dhMTcR6Cd4Ck00SVDJy29aKs3wL0S8rSWzQj3L/Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1763678427; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=H7tKuMO0yid7IKXyGcjRGAOc7nAr6hvyE2Y7rR0Dwr8=; b=KSAT4Xse2pJiFwW2n2fcNj9flc0UeN17rbIBNIKzaBvu9oaL7nBPoPpBjbtxkBm2/Bo8DsaDHWLy7EnghNDBDixoRD6fKiuQK7xrLCR9JXT2OARLOul+4IHpxcHNDsM1npwizT8sNKTj+5O888bRCe3IH98CDTYSU6ucXMzPr3k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1763678427557642.1094094464291; Thu, 20 Nov 2025 14:40:27 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 0AD104424B; Thu, 20 Nov 2025 17:40:27 -0500 (EST) Received: from [172.19.199.53] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id F2C574453E; Thu, 20 Nov 2025 17:37:14 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id 8F49E41A34; Thu, 20 Nov 2025 17:35:07 -0500 (EST) Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (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 0534744133 for ; Thu, 20 Nov 2025 17:35:00 -0500 (EST) Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5AKCQ7uP007033 for ; Thu, 20 Nov 2025 22:35:00 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4aejmsyjf7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 20 Nov 2025 22:35:00 +0000 (GMT) Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 5AKKHKuq022311 for ; Thu, 20 Nov 2025 22:34:59 GMT Received: from smtprelay06.dal12v.mail.ibm.com ([172.16.1.8]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4af4un90et-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 20 Nov 2025 22:34:59 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay06.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 5AKMYxin22348536 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 20 Nov 2025 22:34:59 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 294AB58058 for ; Thu, 20 Nov 2025 22:34:59 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EECCF5806B for ; Thu, 20 Nov 2025 22:34:58 +0000 (GMT) Received: from li-d664314c-3171-11b2-a85c-fa8047ef35bd.pok.ibm.com (unknown [9.12.68.85]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP for ; Thu, 20 Nov 2025 22:34:58 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_PASS autolearn=unavailable autolearn_force=no version=4.0.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h= content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=H7tKuMO0yid7IKXyG cjRGAOc7nAr6hvyE2Y7rR0Dwr8=; b=gV5v1+EWbk/X1vKtfk9aXntQ3rfzWGrhZ 4wnbjps3eH4qneo3UUpscX4X2T47ja7WJxGXBxgglVR+DOJQKlxrMJztbcloCCBH h/LcZYpgBgBMKrL1fNt3f/7Qoc+syjKmj3n69XB3qYUtJVcyz5Ix2vUqD+WJTB96 4qdqGB8SzClRP8Uf9mXrrgZwrhobsdpycmHSfRze9QGb6setNKGb3yqN75wSGI7S FpodDoAhqEYwhJMxNj+vnAwwswlPYHO2bMOado9syqfour7Uj8FsYMpsOAQEiq9x 6Fedff8Fthck36sFX6HYT8UBLgXZtZPtcswGF80jezUDPwKIKIycQ== From: Collin Walling To: devel@lists.libvirt.org Subject: [PATCH v1 4/4] qemu: only allow enabling deprecated features that are supported Date: Thu, 20 Nov 2025 17:34:43 -0500 Message-ID: <20251120223443.45446-5-walling@linux.ibm.com> X-Mailer: git-send-email 2.51.1 In-Reply-To: <20251120223443.45446-1-walling@linux.ibm.com> References: <20251120223443.45446-1-walling@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: W1LdhUrcKt__UbcW98qcUf-ZcJqB-Rkj X-Authority-Analysis: v=2.4 cv=Rv3I7SmK c=1 sm=1 tr=0 ts=691f9794 cx=c_pps a=GFwsV6G8L6GxiO2Y/PsHdQ==:117 a=GFwsV6G8L6GxiO2Y/PsHdQ==:17 a=6UeiqGixMTsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VnNF1IyMAAAA:8 a=t2O1j-9a2juBSddUIE4A:9 X-Proofpoint-GUID: W1LdhUrcKt__UbcW98qcUf-ZcJqB-Rkj X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTE1MDAzMiBTYWx0ZWRfX3caa2NjveqnH MKUN8ElRZbmYmj/5LxscjLB8kTtz1RczAjYW7nlYGC8yoUOBpjLGXDKdFinw6EX3LzMiHyte62b a3usHbo/PLXB7/F+hSuNCDqveUvdZLnT4i0R1kK367bWUGWmwlJRuw64y4ethAWx+yTeBXqS/TD jLqlsg3YhJhZVnfwFzjT4N8BXxYqaRmgr2A8kor/YJ/X5KT2CAr3nSAnCawSSjKvNUApYJkaLkl jGOlZpaVOln66HnTsUfLxnXj2mk3NL1RGKc+zMivmRUw1jamPm3W87tGCDUTcTUTpkcEy0robMQ xFizXDXcFzEGtUpWRteyEg2lbcQSm5/xR5Z6MEngeDybKKku4g0FCHXnDNPkGIZyxZ4ofrd0Tb6 I+XxK1SJWfPTHTOs/dJINpl+JqL5eA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-11-20_09,2025-11-20_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 clxscore=1015 phishscore=0 priorityscore=1501 spamscore=0 lowpriorityscore=0 impostorscore=0 adultscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2510240000 definitions=main-2511150032 Message-ID-Hash: TO5G23FDPUYHUHVWG3WHUVEK2REGSXK6 X-Message-ID-Hash: TO5G23FDPUYHUHVWG3WHUVEK2REGSXK6 X-MailFrom: walling@linux.ibm.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-devel.lists.libvirt.org-0; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-ZohoMail-DKIM: pass (identity @ibm.com) X-ZM-MESSAGEID: 1763678428480018900 Content-Type: text/plain; charset="utf-8" When updating the guest CPU model and the deprecated_features attribute is set to on, only enable the features the model can actually enable. While host-model would normally just enable these features without intervention (and without the presence of the deprecated_features attribute), custom models would see no changes to their feature set without these changes. This is useful for e.g. testing CPU models. Fixes: f279ea36 (qemu: process: refactor deprecated features code) Signed-off-by: Collin Walling --- src/qemu/qemu_capabilities.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 2dfdedfa1a..cee7a0f5ef 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3437,15 +3437,24 @@ virQEMUCapsUpdateCPUDeprecatedFeatures(virQEMUCaps = *qemuCaps, virCPUFeaturePolicy policy) { qemuMonitorCPUModelInfo *modelInfo; + GStrv props; size_t i; =20 modelInfo =3D virQEMUCapsGetCPUModelInfo(qemuCaps, virtType); =20 - if (!modelInfo || !modelInfo->full_dep_props) + if (!modelInfo) return; =20 - for (i =3D 0; i < g_strv_length(modelInfo->full_dep_props); i++) { - virCPUDefUpdateFeature(cpu, modelInfo->full_dep_props[i], policy); + /* Only allow policy "require" on features that are actually + * supported on the CPU model */ + if (policy =3D=3D VIR_CPU_FEATURE_REQUIRE) { + props =3D modelInfo->static_dep_props; + } else { + props =3D modelInfo->full_dep_props; + } + + for (i =3D 0; i < g_strv_length(props); i++) { + virCPUDefUpdateFeature(cpu, props[i], policy); } } =20 --=20 2.51.1