From nobody Fri Nov 21 10:00:05 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=1763678271; cv=none; d=zohomail.com; s=zohoarc; b=MRPxV7VleqDQ9RHvnCnwi6rEW1tyjQ2d5JUvDg5BQRjrAo6fqNj/YotMk5/UDna7KgeCRUXZAPfdC/KWTl0VDsbAo77mv9inXTSypHK1pz/USTgOTJwLbSpxHm52cQu/vVm/4gMj4fOgeQc5UXr1w1RNVdKNDPBrVk1A79gzjFY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1763678271; 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=gxYiZV3UkJPG9FBxyIYPgj+eOsXlef/A61sWHiqODbA=; b=bY2Abh+8bx3XRiVt+OEVMS+deWg6UH0V4gaaNgMYqUIkJ7Gr4kGFE95RBHuibBmYeqFfAfOZXBch0HiJ+UemvHSG9Yd0xaOPg0JZSmq0f57k/sWFdgaATip/sQyVDhTChRpufx9nebcfr5ZcRFppqruKuLF74puizQSk8B1v850= 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 1763678271657910.2855724823589; Thu, 20 Nov 2025 14:37:51 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 2B6D74438E; Thu, 20 Nov 2025 17:37:51 -0500 (EST) Received: from [172.19.199.53] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id CB72744291; Thu, 20 Nov 2025 17:36:51 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id AA38844125; Thu, 20 Nov 2025 17:35:05 -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 21D5844121 for ; Thu, 20 Nov 2025 17:35:00 -0500 (EST) Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5AKCw5eF013736 for ; Thu, 20 Nov 2025 22:34:59 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4aejgx7hff-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 20 Nov 2025 22:34:59 +0000 (GMT) Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 5AKKAADx005118 for ; Thu, 20 Nov 2025 22:34:59 GMT Received: from smtprelay03.dal12v.mail.ibm.com ([172.16.1.5]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 4af5bkh01k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 20 Nov 2025 22:34:58 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay03.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 5AKMYwWP5964396 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 20 Nov 2025 22:34:58 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3EB0A5806B for ; Thu, 20 Nov 2025 22:34:58 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 100C25806D 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:57 +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=gxYiZV3UkJPG9FBxy IYPgj+eOsXlef/A61sWHiqODbA=; b=Up1QlQscu9aIcVuR5roxf6MqtOk99+LsG 34gSA18peCAEj94u8PKYAdHl68bZ8rkQTqCLgcvwKNZgkRYemnpYPfIs3tCPifKj aw3JSNBNgtRAneAcOK9x6WtZeyzVAHcdGN0ikjlXtRgU96PgXRrheFmm2gD4RZQr d/A62xWwi+7FUS2GttOXj/CWfbqV1D+BKHmVKmNE6OuaWsNlrP80IxF6z6cvXN2+ LWC+BugAj5nWwXq8Z+y0vsgLxZziM912oZD0GHjbJvuWFQTI/KQYUE3jZJZ2XJwA cPBbLeZQK8lxsNQ+mN1d0cjPO4vSX3WnMSbyBO4Hxgu/iYbMcQ+wg== From: Collin Walling To: devel@lists.libvirt.org Subject: [PATCH v1 1/4] qemu: rename modelinfo's deprecated_props to full_dep_props Date: Thu, 20 Nov 2025 17:34:40 -0500 Message-ID: <20251120223443.45446-2-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-GUID: wjAJvwwZRctvi5sf4fNaixxGeT89kYYa X-Authority-Analysis: v=2.4 cv=YqwChoYX c=1 sm=1 tr=0 ts=691f9793 cx=c_pps a=3Bg1Hr4SwmMryq2xdFQyZA==:117 a=3Bg1Hr4SwmMryq2xdFQyZA==:17 a=6UeiqGixMTsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VnNF1IyMAAAA:8 a=K8gv1na5YGQBj6Gsb9sA:9 X-Proofpoint-ORIG-GUID: wjAJvwwZRctvi5sf4fNaixxGeT89kYYa X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTE1MDAzMiBTYWx0ZWRfXyE/N6ykN5zPV /bdKjXUF4HegVNJ7SH7mmH8lC7Gzg/CaNm7JzpadjM2TZnBtW2k6JDU1qlsFAxSaEhItxjREPTE zAY4uxhdlMDrQ8MS4M0OilaS0Z4f9hFGtJT+bjD0R9ia0f8u9C0gKMO3hq5KbTsC04eU6s+i4ub cEKBanPY7EevSXeAmS8ra1mabbaGjiyLHsrUwl2pCRiL3Rs21ue7dUQiVsgCo9+u1F/P19CDiCd rqpDVbowAVG/zP8z+0jiGJyoK8HPRMyFQ+tRP+D0jRG/o7RQLhzq/Z3w4QCjWIFaW9HUTrSG4zs lD7EEwhM6bUaGh04vv2L2FRGY/tgdWIcsHyf582pf+H8r/E8/t5gJfDIOoZPJXB0j3fO49PQ2G3 UNct3gOF0+MoJvGf0W0xqGAoJxripw== 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 priorityscore=1501 impostorscore=0 lowpriorityscore=0 malwarescore=0 clxscore=1015 adultscore=0 bulkscore=0 phishscore=0 spamscore=0 suspectscore=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: LCZAT77RYDEROMY5OQ4WEGGITO73U6HX X-Message-ID-Hash: LCZAT77RYDEROMY5OQ4WEGGITO73U6HX 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: 1763678272098018900 Content-Type: text/plain; charset="utf-8" The current query of deprecated properties is the result of a full model expansion. Rename the field to reflect this. Signed-off-by: Collin Walling --- src/qemu/qemu_capabilities.c | 22 +++++++++++----------- src/qemu/qemu_monitor.c | 4 ++-- src/qemu/qemu_monitor.h | 2 +- src/qemu/qemu_monitor_json.c | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 205bf3d0b8..bcc7c5b602 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -3275,9 +3275,9 @@ virQEMUCapsProbeFullDeprecatedProperties(qemuMonitor = *mon, cpu, true, false, false, &propsInf= o) < 0) return -1; =20 - if (propsInfo && propsInfo->deprecated_props) { + if (propsInfo && propsInfo->full_dep_props) { g_strfreev(*props); - *props =3D g_steal_pointer(&propsInfo->deprecated_props); + *props =3D g_steal_pointer(&propsInfo->full_dep_props); } =20 return 0; @@ -3366,7 +3366,7 @@ virQEMUCapsProbeQMPHostCPU(virQEMUCaps *qemuCaps, } =20 if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_QUERY_CPU_MODEL_EXPANSION_DEPRE= CATED_PROPS) && - virQEMUCapsProbeFullDeprecatedProperties(mon, cpu, &modelInfo->dep= recated_props) < 0) + virQEMUCapsProbeFullDeprecatedProperties(mon, cpu, &modelInfo->ful= l_dep_props) < 0) return -1; =20 if (virQEMUCapsTypeIsAccelerated(virtType) && @@ -3441,11 +3441,11 @@ virQEMUCapsUpdateCPUDeprecatedFeatures(virQEMUCaps = *qemuCaps, =20 modelInfo =3D virQEMUCapsGetCPUModelInfo(qemuCaps, virtType); =20 - if (!modelInfo || !modelInfo->deprecated_props) + if (!modelInfo || !modelInfo->full_dep_props) return; =20 - for (i =3D 0; i < g_strv_length(modelInfo->deprecated_props); i++) { - virCPUDefUpdateFeature(cpu, modelInfo->deprecated_props[i], policy= ); + for (i =3D 0; i < g_strv_length(modelInfo->full_dep_props); i++) { + virCPUDefUpdateFeature(cpu, modelInfo->full_dep_props[i], policy); } } =20 @@ -4210,12 +4210,12 @@ virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsAccel *c= aps, if ((deprecated_props =3D virXPathNode("./deprecatedFeatures", ctxt)))= { g_autoptr(GPtrArray) props =3D virXMLNodeGetSubelementList(depreca= ted_props, NULL); =20 - hostCPU->deprecated_props =3D g_new0(char *, props->len + 1); + hostCPU->full_dep_props =3D g_new0(char *, props->len + 1); =20 for (i =3D 0; i < props->len; i++) { xmlNodePtr prop =3D g_ptr_array_index(props, i); =20 - if (!(hostCPU->deprecated_props[i] =3D virXMLPropString(prop, = "name"))) { + if (!(hostCPU->full_dep_props[i] =3D virXMLPropString(prop, "n= ame"))) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("missing 'name' attribute for a host CPU = model deprecated property in QEMU capabilities cache")); return -1; @@ -4979,13 +4979,13 @@ virQEMUCapsFormatHostCPUModelInfo(virQEMUCapsAccel = *caps, virBufferAddLit(buf, "/>\n"); } =20 - if (model->deprecated_props) { + if (model->full_dep_props) { virBufferAddLit(buf, "\n"); virBufferAdjustIndent(buf, 2); =20 - for (i =3D 0; i < g_strv_length(model->deprecated_props); i++) + for (i =3D 0; i < g_strv_length(model->full_dep_props); i++) virBufferAsprintf(buf, "\n", - model->deprecated_props[i]); + model->full_dep_props[i]); =20 virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 0f1a9d13f5..bcedd96f4e 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3374,7 +3374,7 @@ qemuMonitorCPUModelInfoFree(qemuMonitorCPUModelInfo *= model_info) g_free(model_info->props[i].value.string); } =20 - g_strfreev(model_info->deprecated_props); + g_strfreev(model_info->full_dep_props); g_free(model_info->props); g_free(model_info->name); g_free(model_info); @@ -3419,7 +3419,7 @@ qemuMonitorCPUModelInfoCopy(const qemuMonitorCPUModel= Info *orig) } } =20 - copy->deprecated_props =3D g_strdupv(orig->deprecated_props); + copy->full_dep_props =3D g_strdupv(orig->full_dep_props); =20 return copy; } diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index dd038f2775..6cd9329787 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1430,7 +1430,7 @@ struct _qemuMonitorCPUModelInfo { char *name; size_t nprops; qemuMonitorCPUProperty *props; - GStrv deprecated_props; + GStrv full_dep_props; /* deprecated properties resulting from a full= model expansion */ bool migratability; }; =20 diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index a4cbc222a8..e911c1929c 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5401,7 +5401,7 @@ qemuMonitorJSONParseCPUModelExpansion(const char *cpu= _name, =20 if (cpu_deprecated_props && virJSONValueArraySize(cpu_deprecated_props) && - (!(expanded_model->deprecated_props =3D virJSONValueArrayToStringL= ist(cpu_deprecated_props)))) { + (!(expanded_model->full_dep_props =3D virJSONValueArrayToStringLis= t(cpu_deprecated_props)))) { return -1; } =20 --=20 2.51.1 From nobody Fri Nov 21 10:00:05 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=1763678331; cv=none; d=zohomail.com; s=zohoarc; b=V9+sn1GfpJHmD0f5QyQk4ubohcgHBEPDVkKcCDL7w+ZaM1ARsP5H0Yht9Dj5tWBU4jTYR/dleNFw2oitiCzQQqLmjeuwcB6bGV9hB/Xk+BKftT1+CEaGe2F5UzE390RlIUBOh02qmQaMzBzHSgdItycP6kTQ53ymTGqi+wJr9Q0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1763678331; 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=Uk/N+4wprFXyd+F7m5yUoM4HNXcgm39vy9ON75zJXmw=; b=O8l9+A+95uzx7Vn3eXvIPDMYSrDNRv3JTuUd4aDpWeQxPH75UhIbPZ+Mp/WlPbKeAqXvh/4HkwvcgsjKhcyQ+Z0jhptrjpdvYE6L6hXY8H9vCGAbhm/+qwkqlM05r4ihvvjMrxZkmWR89Yk5ldYChx07wL5QCMi4F0NzbkeR7A0= 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 1763678331885113.90876772535603; Thu, 20 Nov 2025 14:38:51 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id 40706418AC; Thu, 20 Nov 2025 17:38:51 -0500 (EST) Received: from [172.19.199.53] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id E502544219; Thu, 20 Nov 2025 17:37:01 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id D14FF41A34; Thu, 20 Nov 2025 17:35:05 -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 5C5754412A for ; Thu, 20 Nov 2025 17:35:00 -0500 (EST) Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5AKLRMiq003872 for ; Thu, 20 Nov 2025 22:35:00 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4aejju7ehp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 20 Nov 2025 22:34:59 +0000 (GMT) Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 5AKJfeTF010411 for ; Thu, 20 Nov 2025 22:34:58 GMT Received: from smtprelay03.dal12v.mail.ibm.com ([172.16.1.5]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 4af3ush5q4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 20 Nov 2025 22:34:58 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay03.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 5AKMYwb719530242 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 20 Nov 2025 22:34:58 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 859AD58058 for ; Thu, 20 Nov 2025 22:34:58 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 56DFD5806D 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=Uk/N+4wprFXyd+F7m 5yUoM4HNXcgm39vy9ON75zJXmw=; b=HMRFQ9OR0DyMS24MsCYf5FToyl1V75b7t CiF4bzos+eN3nRezEN+rG1wWtA5WBH4l2Q1hvwxaDeBRYENH6s8IUXSn+Gn5Edi7 eEiw7T9txk+jLsCNRPPoKkdkCDjCItlF0VBWIQjQ/w5WOV7bK2TF6FQO9NQD6bSo WM1GKd8v56nmjHH848dxatfozLvq2lQyJUuutNeLuJgoMddoeZqIkeeFbSGSCQKr Cd36aKy0UEEzjXd5Vk8bQ+9KHl9qJfWIW1fPHmRQXjbk2Zl1zga1g0cMLZHrkhe0 gxhEcP0/M+vpc6hLOVNWuE4uk57ta8RaJnNRBmVeIPAGOU9l/K8Wg== From: Collin Walling To: devel@lists.libvirt.org Subject: [PATCH v1 2/4] qemu: refactor load/format of deprecated features Date: Thu, 20 Nov 2025 17:34:41 -0500 Message-ID: <20251120223443.45446-3-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-GUID: zYos5IIHSX9xCGMheyFWQAf5QU_DpX4r X-Proofpoint-ORIG-GUID: zYos5IIHSX9xCGMheyFWQAf5QU_DpX4r X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTE1MDAzMiBTYWx0ZWRfX+GU12G1bEqg/ h9t1pNW3IMCOLz+mFv+p7HV5l08CQ0ae73zkJzEuj+rWidbS9Mu+k26R6qzRb+HZjo3ksee3u5Z 84oUfUaeBtIm+Ew5kU7uczl+FRDZ1SZ0KvzO5E87OhcSem2NmyvK2nmJ1SaE7ZJDoF/5uZ5Ihhe KwPTwT+SNlZqg+vNF6fgWgRpd1SZcMxLbroR47vlSl4tUlxoy8REUNx5zfxZxTzSEPZ+smMahGU u1rojNDWoZzlNU95UdUOy2UO0V5Iq+l5LUEfSiW/h1yc05/74VJ2dUEEVBC+6kE0jgBDwAy/4eS Qj2Jrm08+cPpIO5s5HbCwKU9kdK0ecaL53RiB4gkCV9ENoLptGnLZJNfWqWERF3ZoUblHJyHUv6 +XOFxVXY0jT4LRcsUclv6EVJYacWyw== X-Authority-Analysis: v=2.4 cv=SvOdKfO0 c=1 sm=1 tr=0 ts=691f9793 cx=c_pps a=bLidbwmWQ0KltjZqbj+ezA==:117 a=bLidbwmWQ0KltjZqbj+ezA==:17 a=6UeiqGixMTsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VnNF1IyMAAAA:8 a=ybTZXA7WAAAA:8 a=pyy5daH9qZ21Xrr4Q9MA:9 a=HcEtEu571YGEX4aK26Fo:22 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 priorityscore=1501 lowpriorityscore=0 spamscore=0 clxscore=1015 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 impostorscore=0 malwarescore=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: 34PPJUPQBKBRPFBKF7LZVPE6BDWPBTGF X-Message-ID-Hash: 34PPJUPQBKBRPFBKF7LZVPE6BDWPBTGF 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: 1763678332207018900 Content-Type: text/plain; charset="utf-8" Signed-off-by: Collin Walling --- src/qemu/qemu_capabilities.c | 81 ++++++++++++++++++++++++------------ 1 file changed, 54 insertions(+), 27 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index bcc7c5b602..3243ba8ad3 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4106,13 +4106,40 @@ virQEMUCapsSetCPUModelInfo(virQEMUCaps *qemuCaps, } =20 =20 +static int +virQEMUCapsParseHostCPUModelInfoDepFeats(xmlXPathContextPtr ctxt, + GStrv *dep_props, + const char *xpath) +{ + xmlNodePtr node; + size_t i; + + if ((node =3D virXPathNode(xpath, ctxt))) { + g_autoptr(GPtrArray) props =3D virXMLNodeGetSubelementList(node, N= ULL); + + *dep_props =3D g_new0(char *, props->len + 1); + + for (i =3D 0; i < props->len; i++) { + xmlNodePtr prop =3D g_ptr_array_index(props, i); + + if (!((*dep_props)[i] =3D virXMLPropString(prop, "name"))) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("missing 'name' attribute for a host CPU= model deprecated property in QEMU capabilities cache")); + return -1; + } + } + } + + return 0; +} + + static int virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsAccel *caps, xmlXPathContextPtr ctxt, const char *typeStr) { xmlNodePtr hostCPUNode; - xmlNodePtr deprecated_props; g_autofree xmlNodePtr *nodes =3D NULL; VIR_XPATH_NODE_AUTORESTORE(ctxt) g_autoptr(qemuMonitorCPUModelInfo) hostCPU =3D NULL; @@ -4206,21 +4233,9 @@ virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsAccel *ca= ps, } =20 ctxt->node =3D hostCPUNode; - - if ((deprecated_props =3D virXPathNode("./deprecatedFeatures", ctxt)))= { - g_autoptr(GPtrArray) props =3D virXMLNodeGetSubelementList(depreca= ted_props, NULL); - - hostCPU->full_dep_props =3D g_new0(char *, props->len + 1); - - for (i =3D 0; i < props->len; i++) { - xmlNodePtr prop =3D g_ptr_array_index(props, i); - - if (!(hostCPU->full_dep_props[i] =3D virXMLPropString(prop, "n= ame"))) { - virReportError(VIR_ERR_INTERNAL_ERROR, "%s", - _("missing 'name' attribute for a host CPU = model deprecated property in QEMU capabilities cache")); - return -1; - } - } + if (virQEMUCapsParseHostCPUModelInfoDepFeats(ctxt, &hostCPU->full_dep_= props, + "./deprecatedFeatures") < = 0) { + return -1; } =20 caps->hostCPU.info =3D g_steal_pointer(&hostCPU); @@ -4930,6 +4945,27 @@ virQEMUCapsLoadCache(virArch hostArch, } =20 =20 +static void +virQEMUCapsFormatHostCPUModelInfoDepFeats(virBuffer *buf, + GStrv props, + const char *xmlStr) +{ + size_t i; + + if (!props) + return; + + virBufferAsprintf(buf, "<%s>\n", xmlStr); + virBufferAdjustIndent(buf, 2); + + for (i =3D 0; i < g_strv_length(props); i++) + virBufferAsprintf(buf, "\n", props[i]); + + virBufferAdjustIndent(buf, -2); + virBufferAsprintf(buf, "\n", xmlStr); +} + + static void virQEMUCapsFormatHostCPUModelInfo(virQEMUCapsAccel *caps, virBuffer *buf, @@ -4979,17 +5015,8 @@ virQEMUCapsFormatHostCPUModelInfo(virQEMUCapsAccel *= caps, virBufferAddLit(buf, "/>\n"); } =20 - if (model->full_dep_props) { - virBufferAddLit(buf, "\n"); - virBufferAdjustIndent(buf, 2); - - for (i =3D 0; i < g_strv_length(model->full_dep_props); i++) - virBufferAsprintf(buf, "\n", - model->full_dep_props[i]); - - virBufferAdjustIndent(buf, -2); - virBufferAddLit(buf, "\n"); - } + virQEMUCapsFormatHostCPUModelInfoDepFeats(buf, model->full_dep_props, + "deprecatedFeatures"); =20 virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); --=20 2.51.1 From nobody Fri Nov 21 10:00:05 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=1763678381; cv=none; d=zohomail.com; s=zohoarc; b=lpaszMW1DLMl1Q46drwP/oyqWYr+0+sU9nQ0VV8A6ryO3s5FtaqsNK5wV7f7pMAn3E+fNbV6nkuvaaO8UKlKnXywbonuUHkKXJJ9IvM6ymWjPFCYiqzONNY9z1wXdmGtvppMOvnWD7RPF9rNPQVmZ0wJrNTv9h+yykIbW1TXRcQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1763678381; 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=ckN4aSLYgUBs4zC4oMsZH4I1uX2VWUqDhsZB22b69cs=; b=ZubZbr3bVSsu/SPA6AjGpK4li1JwEzfiA/vGmUNY1xxfGZGF/23hKfP7QDP1uP0yRd34iwv3ahgztzQEux318dRniFr7FsTR33gXXjtn5Ow4LbbTF3bOoM7Gp3AVH/vAVE6FTgJnl/yUJHuEYIHr0AvC2RbGhLrwO0PZ3x3RK6M= 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 1763678381602568.8998199640573; Thu, 20 Nov 2025 14:39:41 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 993) id E257244240; Thu, 20 Nov 2025 17:39:40 -0500 (EST) Received: from [172.19.199.53] (lists.libvirt.org [8.43.85.245]) by lists.libvirt.org (Postfix) with ESMTP id D09F244264; Thu, 20 Nov 2025 17:37:09 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 993) id D269C44121; Thu, 20 Nov 2025 17:35:06 -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 A57304412D for ; Thu, 20 Nov 2025 17:35:00 -0500 (EST) Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 5AKD24Gk003670 for ; Thu, 20 Nov 2025 22:35:00 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4aejju7ehq-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 (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 5AKL3lSX006954 for ; Thu, 20 Nov 2025 22:34:59 GMT Received: from smtprelay03.dal12v.mail.ibm.com ([172.16.1.5]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 4af62jrskk-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 smtprelay03.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 5AKMYwcs5964402 (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 D69B25806D for ; Thu, 20 Nov 2025 22:34:58 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9E3115806B 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=ckN4aSLYgUBs4zC4o MsZH4I1uX2VWUqDhsZB22b69cs=; b=mXicoZBkZ04bx/p52oJxuws4kbMXEEaxi qzkoMGETrpCA3Hd6SaP+0deCXEeQHEpoSqOzZ+MIxUfi394lDMb7TsWA5Rzq5wh0 V3mke5LvaqRyCt3LpmAxKbzHSUtB6TAD8nBXXW1lo8QEYOUdHi+zBVm/rqfI3pG1 geJE0stBtbUEor5vTKH4l7P8uSqPbCxc/zZiK+8ouH6tJ4vnMZhSZVM5I9qFSYcb fVVuIapF9fJmkzTRFK+kL/8e2oFP4RJylBGikU9HzIiE7fB98ifr4Snp3blGO+sG 00y59a3/7npRtbEd79z16ILXdwtdOtdjQG3nKpbQEKUrHstpVjLuw== From: Collin Walling To: devel@lists.libvirt.org Subject: [PATCH v1 3/4] qemu: query and cache static/host deprecated features Date: Thu, 20 Nov 2025 17:34:42 -0500 Message-ID: <20251120223443.45446-4-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-GUID: -TJeVgRRhJYY44AnFR72WvY3E4LQt3g5 X-Proofpoint-ORIG-GUID: -TJeVgRRhJYY44AnFR72WvY3E4LQt3g5 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMTE1MDAzMiBTYWx0ZWRfX4vb0nNkapZGd Q/XXnVT2YmUqbLwNiRrXOzca6EWKca8ARpq4y2x77TyTqgbjTWXr7v+zgrzn6wiL0sta3bj5W0V 0TyQ5CrVlM0RxU6M6odVdf5MCivr2Dx7Jjk4Nf6+YiX/CpXgydsmmved+boxKAcPxHAjXiVETWm x4r7fJicTbAgoCRVqZ8x3xlExTRE/1PSGrbCX7qHz6h0xTbnFUvbkymyZIcaW5E2SIq1CbeAsXb 8Dk7GXUNvhXQkDep7I4ctY05PELtYelKub3cYzGDKTyJ5spFEnK3iHqMkXKzK4jpQnVHmc7i7PX t3RKzkOJVABZO2ZEQU56y7YZKNbrDz/gDsPVTNV+BWth9GV2vQJZAvUCHjT3gyTlRpXCdco8h9G cssF+Xptfra9gtiJ7cMEP/P6hi4E5A== X-Authority-Analysis: v=2.4 cv=SvOdKfO0 c=1 sm=1 tr=0 ts=691f9794 cx=c_pps a=AfN7/Ok6k8XGzOShvHwTGQ==:117 a=AfN7/Ok6k8XGzOShvHwTGQ==:17 a=6UeiqGixMTsA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VnNF1IyMAAAA:8 a=N2pE1BlU1f8Gxc6xX18A:9 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 priorityscore=1501 lowpriorityscore=0 spamscore=0 clxscore=1015 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 impostorscore=0 malwarescore=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: ZWPQWIYZD3Q4ECUISW2ZURE3DEJVEAX2 X-Message-ID-Hash: ZWPQWIYZD3Q4ECUISW2ZURE3DEJVEAX2 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: 1763678382305018900 Content-Type: text/plain; charset="utf-8" When performing a static CPU model expansion, the reported list of deprecated features will reflect the features which are currently enabled on the CPU model. Retrieve this subset and store them as static deprecated properties for the model info, and as host deprecated features in the cache. Note that this list may exclude items that are shown in the list, as some feature support has been dropped by hardware (e.g. csske). Signed-off-by: Collin Walling --- src/qemu/qemu_capabilities.c | 6 +++++- src/qemu/qemu_monitor.c | 2 ++ src/qemu/qemu_monitor.h | 1 + src/qemu/qemu_monitor_json.c | 17 +++++++++++++++-- .../qemucapabilitiesdata/caps_10.0.0_s390x.xml | 6 ++++++ tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml | 6 ++++++ tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml | 6 ++++++ 7 files changed, 41 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c index 3243ba8ad3..2dfdedfa1a 100644 --- a/src/qemu/qemu_capabilities.c +++ b/src/qemu/qemu_capabilities.c @@ -4234,7 +4234,9 @@ virQEMUCapsLoadHostCPUModelInfo(virQEMUCapsAccel *cap= s, =20 ctxt->node =3D hostCPUNode; if (virQEMUCapsParseHostCPUModelInfoDepFeats(ctxt, &hostCPU->full_dep_= props, - "./deprecatedFeatures") < = 0) { + "./deprecatedFeatures") < = 0 || + virQEMUCapsParseHostCPUModelInfoDepFeats(ctxt, &hostCPU->static_de= p_props, + "./hostDeprecatedFeatures"= ) < 0) { return -1; } =20 @@ -5017,6 +5019,8 @@ virQEMUCapsFormatHostCPUModelInfo(virQEMUCapsAccel *c= aps, =20 virQEMUCapsFormatHostCPUModelInfoDepFeats(buf, model->full_dep_props, "deprecatedFeatures"); + virQEMUCapsFormatHostCPUModelInfoDepFeats(buf, model->static_dep_props, + "hostDeprecatedFeatures"); =20 virBufferAdjustIndent(buf, -2); virBufferAddLit(buf, "\n"); diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index bcedd96f4e..504500c864 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -3375,6 +3375,7 @@ qemuMonitorCPUModelInfoFree(qemuMonitorCPUModelInfo *= model_info) } =20 g_strfreev(model_info->full_dep_props); + g_strfreev(model_info->static_dep_props); g_free(model_info->props); g_free(model_info->name); g_free(model_info); @@ -3420,6 +3421,7 @@ qemuMonitorCPUModelInfoCopy(const qemuMonitorCPUModel= Info *orig) } =20 copy->full_dep_props =3D g_strdupv(orig->full_dep_props); + copy->static_dep_props =3D g_strdupv(orig->static_dep_props); =20 return copy; } diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index 6cd9329787..d096f474c1 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -1431,6 +1431,7 @@ struct _qemuMonitorCPUModelInfo { size_t nprops; qemuMonitorCPUProperty *props; GStrv full_dep_props; /* deprecated properties resulting from a full= model expansion */ + GStrv static_dep_props; /* deprecated properties resulting from a stat= ic model expansion */ bool migratability; }; =20 diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index e911c1929c..494d7ef515 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -5392,19 +5392,32 @@ static int qemuMonitorJSONParseCPUModelExpansion(const char *cpu_name, virJSONValue *cpu_props, virJSONValue *cpu_deprecated_props, + qemuMonitorCPUModelExpansionType typ= e, qemuMonitorCPUModelInfo **model_info) { g_autoptr(qemuMonitorCPUModelInfo) expanded_model =3D NULL; + GStrv dep_props =3D NULL; =20 if (qemuMonitorJSONParseCPUModel(cpu_name, cpu_props, &expanded_model)= < 0) return -1; =20 if (cpu_deprecated_props && virJSONValueArraySize(cpu_deprecated_props) && - (!(expanded_model->full_dep_props =3D virJSONValueArrayToStringLis= t(cpu_deprecated_props)))) { + (!(dep_props =3D virJSONValueArrayToStringList(cpu_deprecated_prop= s)))) { return -1; } =20 + switch (type) { + case QEMU_MONITOR_CPU_MODEL_EXPANSION_STATIC: + expanded_model->static_dep_props =3D dep_props; + break; + + case QEMU_MONITOR_CPU_MODEL_EXPANSION_STATIC_FULL: + case QEMU_MONITOR_CPU_MODEL_EXPANSION_FULL: + expanded_model->full_dep_props =3D dep_props; + break; + } + *model_info =3D g_steal_pointer(&expanded_model); return 0; } @@ -5509,7 +5522,7 @@ qemuMonitorJSONGetCPUModelExpansion(qemuMonitor *mon, =20 return qemuMonitorJSONParseCPUModelExpansion(cpu_name, cpu_props, cpu_deprecated_props, - model_info); + type, model_info); } =20 =20 diff --git a/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml b/tests/qemuc= apabilitiesdata/caps_10.0.0_s390x.xml index 0e834544af..82a66a6524 100644 --- a/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml +++ b/tests/qemucapabilitiesdata/caps_10.0.0_s390x.xml @@ -202,6 +202,12 @@ + + + + + + diff --git a/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml b/tests/qemuca= pabilitiesdata/caps_9.1.0_s390x.xml index bdbb60a097..b961f79808 100644 --- a/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml +++ b/tests/qemucapabilitiesdata/caps_9.1.0_s390x.xml @@ -192,6 +192,12 @@ + + + + + + diff --git a/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml b/tests/qemuca= pabilitiesdata/caps_9.2.0_s390x.xml index 8da55b1c4e..e9f79261f7 100644 --- a/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml +++ b/tests/qemucapabilitiesdata/caps_9.2.0_s390x.xml @@ -195,6 +195,12 @@ + + + + + + --=20 2.51.1 From nobody Fri Nov 21 10:00:05 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