From nobody Fri Dec 27 00:14:19 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 1732564184287588.5594157661596; Mon, 25 Nov 2024 11:49:44 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id A8D6B182A; Mon, 25 Nov 2024 14:49:43 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 45E2E186E; Mon, 25 Nov 2024 14:47:33 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 6EF651700; Mon, 25 Nov 2024 14:47:24 -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 DA0F016DA for ; Mon, 25 Nov 2024 14:47:23 -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 4APEwBXM013099 for ; Mon, 25 Nov 2024 19:47:23 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4338d21yng-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 25 Nov 2024 19:47:23 +0000 (GMT) Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 4APJJI1i000859 for ; Mon, 25 Nov 2024 19:47:22 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([172.16.1.9]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 433sry2m5x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 25 Nov 2024 19:47:22 +0000 Received: from smtpav06.dal12v.mail.ibm.com (smtpav06.dal12v.mail.ibm.com [10.241.53.105]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 4APJlLXm55050528 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 25 Nov 2024 19:47:22 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CAABD5805D for ; Mon, 25 Nov 2024 19:47:21 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AE3B95805E for ; Mon, 25 Nov 2024 19:47:21 +0000 (GMT) Received: from li-d664314c-3171-11b2-a85c-fa8047ef35bd.pok.ibm.com (unknown [9.12.68.85]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP for ; Mon, 25 Nov 2024 19:47:21 +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=-2.4 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,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=cgzeRVVGcHn+VrKmO QPkULWreSAPyT9QT0ArZLNUT+M=; b=LRTEGmVa7/seKsTyZCJtrGs9Umo8xa5iN JyMrejbedGaxUezkrCErIGIWrYM4yNIFInb4QF0TymuckdYETm2uPmAVpXx0MGnI aUPIkV9e6+n+QjxwEBYC8ER0pJkCk+u8m7PnnxlovcKKGCMKdjcytGGkfcyHqS+T 7/ZSro1+t24HB7VyLYSnbBo2ow2yA7OvszazCbz2JUfCWIyheOEykt5RwRgoSJxN tqUShEbbhiY96v9sdEW1nNOKNzVlWkH2uDgvQUGn1dBB6yYrCGxHgyvJzJNseA7a 3iaU8LilnblMkcRPk2vj04k1vz9q4P6/n3120bmmCmAvBI7Re+Iig== From: Collin Walling To: devel@lists.libvirt.org Subject: [PATCH v2 5/5] conf: add deprecated_features attribute Date: Mon, 25 Nov 2024 14:46:39 -0500 Message-ID: <20241125194639.15139-6-walling@linux.ibm.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20241125194639.15139-1-walling@linux.ibm.com> References: <20241125194639.15139-1-walling@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Jf8EZiYyYHonPCOq5peUWr2yqSmTXmIv X-Proofpoint-ORIG-GUID: Jf8EZiYyYHonPCOq5peUWr2yqSmTXmIv 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 priorityscore=1501 malwarescore=0 mlxscore=0 suspectscore=0 phishscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 adultscore=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2411250162 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: XTUTDYVY3YZQVUMAM4YDA7LX6TS3YGP5 X-Message-ID-Hash: XTUTDYVY3YZQVUMAM4YDA7LX6TS3YGP5 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: 1732564186466019100 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 bee7a39e4e..c06ca1a833 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -6399,6 +6399,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