From nobody Fri Dec 27 13:29:38 2024 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=reject dis=none) header.from=linux.ibm.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1731433597663745.6296352062668; Tue, 12 Nov 2024 09:46:37 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 95EDA17EE; Tue, 12 Nov 2024 12:46:36 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 4AC9017F5; Tue, 12 Nov 2024 12:43:16 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 4E0571450; Tue, 12 Nov 2024 12:43:03 -0500 (EST) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 AC3E91468 for ; Tue, 12 Nov 2024 12:43:02 -0500 (EST) Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4ACF9wh3032504 for ; Tue, 12 Nov 2024 17:43:01 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 42v9dv0na5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 12 Nov 2024 17:43:01 +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 4ACAUM0f027901 for ; Tue, 12 Nov 2024 17:43:00 GMT Received: from smtprelay06.dal12v.mail.ibm.com ([172.16.1.8]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 42tj2s4r4n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 12 Nov 2024 17:43:00 +0000 Received: from smtpav05.dal12v.mail.ibm.com (smtpav05.dal12v.mail.ibm.com [10.241.53.104]) by smtprelay06.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4ACHh07v54788400 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 12 Nov 2024 17:43:00 GMT Received: from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3391B58052 for ; Tue, 12 Nov 2024 17:43:00 +0000 (GMT) Received: from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 05F3D58067 for ; Tue, 12 Nov 2024 17:43:00 +0000 (GMT) Received: from li-d664314c-3171-11b2-a85c-fa8047ef35bd.ibm.com.com (unknown [9.67.103.128]) by smtpav05.dal12v.mail.ibm.com (Postfix) with ESMTP for ; Tue, 12 Nov 2024 17:42:59 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, 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=ibm.com; h= content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=pp1; bh=/xDW1f37nxbyiQ+Ag irJRwy7c3iSMiFuZdUERY8vZ10=; b=Ftn3Kz0ArMNyLFZkCp4/pizSg4zpJ6l/I JQtez8wQKXN+aK6aTTGcTrLPhleYwtDVBtZoOnGm0PpwyIONgU8fDiN+nyzDpuRS 3cClatjeXxNCsXQu0m2Kt3i+QMVaX8HmJjdtAfEnJLz64Qc3zw8VyAWuj6PCPjJX vedfC5FuM+oQeGVKjTIKirJKIxegJhgaaOdr1FmKTwOasN+B4LjHnUoZ2OvjAsdV Kex6OzYDm4ZBchiEHE1Ky+HE9pvsjSlg15n5NB4L8KE5Iy/sXAAvl/MHqsH29LXA GI5E/CDMxmoRi6auXQ0rg00GpIoHA4kP6bYfuiJdH0VBM77pBP+qA== From: Collin Walling To: devel@lists.libvirt.org Subject: [PATCH v1 5/5] conf: add deprecated_features attribute Date: Tue, 12 Nov 2024 12:40:00 -0500 Message-ID: <20241112174000.27518-6-walling@linux.ibm.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20241112174000.27518-1-walling@linux.ibm.com> References: <20241112174000.27518-1-walling@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 1YPUJwZhv4H3fe3wObtThRimDYUhzxmG X-Proofpoint-ORIG-GUID: 1YPUJwZhv4H3fe3wObtThRimDYUhzxmG X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1051,Hydra:6.0.680,FMLib:17.12.62.30 definitions=2024-10-15_01,2024-10-11_01,2024-09-30_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 lowpriorityscore=0 phishscore=0 bulkscore=0 malwarescore=0 adultscore=0 priorityscore=1501 mlxscore=0 impostorscore=0 mlxlogscore=999 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2411120141 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: TEV7CEO7ODSOJWCW5X3ISGU3QOC5ATSG X-Message-ID-Hash: TEV7CEO7ODSOJWCW5X3ISGU3QOC5ATSG X-MailFrom: walling@linux.ibm.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: 1731433598959116600 Content-Type: text/plain; charset="utf-8" Add a new a attribute, deprecated_features=3D'on|off' to the element. This is used to toggle features flagged as deprecated on the CPU model on or off. When this attribute is paired with 'on', deprecated features will not be filtered. When paired with 'off', any CPU features that are flagged as deprecated will be listed under the CPU model with the 'disable' policy. Example: The absence of this attribute is equivalent to the 'on' option. The deprecated features that will populate the domain XML are the same features that result in the virsh domcapabilities command with the --disable-deprecated-features argument present. It is recommended to define a domain XML with this attribute set to 'off' to ensure migration to machines that may outright drop these features in the future. Signed-off-by: Collin Walling --- src/conf/cpu_conf.c | 10 ++++++++++ src/conf/cpu_conf.h | 1 + src/conf/schemas/cputypes.rng | 12 ++++++++++++ src/qemu/qemu_process.c | 4 ++++ 4 files changed, 27 insertions(+) diff --git a/src/conf/cpu_conf.c b/src/conf/cpu_conf.c index dcc164d165..a9910e2195 100644 --- a/src/conf/cpu_conf.c +++ b/src/conf/cpu_conf.c @@ -238,6 +238,7 @@ virCPUDefCopyWithoutModel(const virCPUDef *cpu) copy->mode =3D cpu->mode; copy->match =3D cpu->match; copy->check =3D cpu->check; + copy->deprecated_feats =3D cpu->deprecated_feats; copy->fallback =3D cpu->fallback; copy->sockets =3D cpu->sockets; copy->dies =3D cpu->dies; @@ -450,6 +451,11 @@ virCPUDefParseXML(xmlXPathContextPtr ctxt, if (virXMLPropEnum(ctxt->node, "check", virCPUCheckTypeFromString, VIR_XML_PROP_NONE, &def->check) < 0) return -1; + + if (virXMLPropTristateSwitch(ctxt->node, "deprecated_features", + VIR_XML_PROP_NONE, + &def->deprecated_feats) < 0) + return -1; } =20 if (def->type =3D=3D VIR_CPU_TYPE_HOST) { @@ -748,6 +754,10 @@ virCPUDefFormatBufFull(virBuffer *buf, virBufferAsprintf(&attributeBuf, " migratable=3D'%s'", virTristateSwitchTypeToString(def->migratabl= e)); } + + if (def->deprecated_feats =3D=3D VIR_TRISTATE_SWITCH_OFF) { + virBufferAddLit(&attributeBuf, " deprecated_features=3D'off'"); + } } =20 /* Format children */ diff --git a/src/conf/cpu_conf.h b/src/conf/cpu_conf.h index f71d942ce6..28e26303ef 100644 --- a/src/conf/cpu_conf.h +++ b/src/conf/cpu_conf.h @@ -161,6 +161,7 @@ struct _virCPUDef { virCPUMaxPhysAddrDef *addr; virHostCPUTscInfo *tsc; virTristateSwitch migratable; /* for host-passthrough mode */ + virTristateSwitch deprecated_feats; }; =20 virCPUDef *virCPUDefNew(void); diff --git a/src/conf/schemas/cputypes.rng b/src/conf/schemas/cputypes.rng index 3a8910e09f..b94b08eb5a 100644 --- a/src/conf/schemas/cputypes.rng +++ b/src/conf/schemas/cputypes.rng @@ -34,6 +34,15 @@ =20 + + + + on + off + + + + @@ -439,6 +448,9 @@ + + + diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 0815bffe3c..93376c6e6b 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6302,6 +6302,10 @@ qemuProcessUpdateGuestCPU(virDomainDef *def, &def->os.arch) < 0) return -1; =20 + if (def->cpu->deprecated_feats =3D=3D VIR_TRISTATE_SWITCH_OFF) { + virQEMUCapsUpdateCPUDeprecatedFeatures(qemuCaps, def->virtType, de= f->cpu); + } + return 0; } =20 --=20 2.45.1