From nobody Mon Nov 25 01:54:36 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=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 1718902736358461.147660665286; Thu, 20 Jun 2024 09:58:56 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 54C7F12C5; Thu, 20 Jun 2024 12:58:55 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id D76A110F5; Thu, 20 Jun 2024 12:58:27 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 525661174; Thu, 20 Jun 2024 12:58:25 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.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 4761712EB for ; Thu, 20 Jun 2024 12:58:14 -0400 (EDT) Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-202-qOmvfdIQPFKGoqGcEpMBGw-1; Thu, 20 Jun 2024 12:58:09 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 78D2B195608E; Thu, 20 Jun 2024 16:58:03 +0000 (UTC) Received: from toolbox.redhat.com (unknown [10.42.28.69]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id A82AE19560B4; Thu, 20 Jun 2024 16:57:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: *** X-Spam-Status: No, score=3.0 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718902693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KubQoAOsjADMhrLc5Y7QFg1cm7D229DwPImLAd/9ko4=; b=LAstmWXB97G/D+r0qJaeEvZSQG88X+TUADH9TDRuF9mZafl59kGTAUMe/mRTmRt4bzDGMx 1plh+zfTbgZNJG8Yz2G93XggYKEvZXfLFJ4lZODdTuZH2CDhi2J4VQbf87q9lC0f0mqTUF 7nVAwTw5qJP9elp93ESFTnPqMFEufgI= X-MC-Unique: qOmvfdIQPFKGoqGcEpMBGw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 01/14] include/hw: add helpers for defining versioned machine types Date: Thu, 20 Jun 2024 17:57:29 +0100 Message-ID: <20240620165742.1711389-2-berrange@redhat.com> In-Reply-To: <20240620165742.1711389-1-berrange@redhat.com> References: <20240620165742.1711389-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: GGJ55H45RM3V2FWPRB4NKLNGMWUYDFUV X-Message-ID-Hash: GGJ55H45RM3V2FWPRB4NKLNGMWUYDFUV X-MailFrom: berrange@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 CC: Halil Pasic , devel@lists.libvirt.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , qemu-s390x@nongnu.org, Richard Henderson , Nicholas Piggin , David Hildenbrand , Ilya Leoshkevich , David Gibson , qemu-arm@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora , Yanan Wang , Eduardo Habkost , Peter Maydell , Daniel Henrique Barboza , Thomas Huth , Paolo Bonzini , Marcel Apfelbaum , Christian Borntraeger , Laurent Vivier , qemu-ppc@nongnu.org, Eric Blake 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: 1718902736712100001 Content-Type: text/plain; charset="utf-8" The various targets which define versioned machine types have a bunch of obfuscated macro code for defining unique function and variable names using string concatenation. This adds a couple of helpers to improve the clarity of such code macro. Reviewed-by: Thomas Huth Reviewed-by: Eric Blake Signed-off-by: Daniel P. Berrang=C3=A9 --- include/hw/boards.h | 185 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 185 insertions(+) diff --git a/include/hw/boards.h b/include/hw/boards.h index 73ad319d7d..d5ad712585 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -413,6 +413,191 @@ struct MachineState { struct NumaState *numa_state; }; =20 +/* + * The macros which follow are intended to facilitate the + * definition of versioned machine types, using a somewhat + * similar pattern across targets. + * + * For example, a macro that can be used to define versioned + * 'virt' machine types would look like: + * + * #define DEFINE_VIRT_MACHINE_IMPL(latest, ...) \ + * static void MACHINE_VER_SYM(class_init, virt, __VA_ARGS__)( \ + * ObjectClass *oc, \ + * void *data) \ + * { \ + * MachineClass *mc =3D MACHINE_CLASS(oc); \ + * MACHINE_VER_SYM(options, virt, __VA_ARGS__)(mc); \ + * mc->desc =3D "QEMU " MACHINE_VER_STR(__VA_ARGS__) " Virtual Ma= chine"; \ + * if (latest) { \ + * mc->alias =3D "virt"; \ + * } \ + * } \ + * static const TypeInfo MACHINE_VER_SYM(info, virt, __VA_ARGS__) =3D= { \ + * .name =3D MACHINE_VER_TYPE_NAME("virt", __VA_ARGS__), \ + * .parent =3D TYPE_VIRT_MACHINE, \ + * .class_init =3D MACHINE_VER_SYM(class_init, virt, __VA_ARGS__)= , \ + * }; \ + * static void MACHINE_VER_SYM(register, virt, __VA_ARGS__)(void) \ + * { \ + * type_register_static(&MACHINE_VER_SYM(info, virt, __VA_ARGS__)= ); \ + * } \ + * type_init(MACHINE_VER_SYM(register, virt, __VA_ARGS__)); + * + * Following this, one (or more) helpers can be added for + * whichever scenarios need to be catered for with a machine: + * + * // Normal 2 digit, marked as latest e.g. 'virt-9.0' + * #define DEFINE_VIRT_MACHINE_LATEST(major, minor) \ + * DEFINE_VIRT_MACHINE_IMPL(true, major, minor) + * + * // Normal 2 digit e.g. 'virt-9.0' + * #define DEFINE_VIRT_MACHINE(major, minor) \ + * DEFINE_VIRT_MACHINE_IMPL(false, major, minor) + * + * // Bugfix 3 digit e.g. 'virt-9.0.1' + * #define DEFINE_VIRT_MACHINE_BUGFIX(major, minor, micro) \ + * DEFINE_VIRT_MACHINE_IMPL(false, major, minor, micro) + * + * // Tagged 2 digit e.g. 'virt-9.0-extra' + * #define DEFINE_VIRT_MACHINE_TAGGED(major, minor, tag) \ + * DEFINE_VIRT_MACHINE_IMPL(false, major, minor, _, tag) + * + * // Tagged bugfix 2 digit e.g. 'virt-9.0.1-extra' + * #define DEFINE_VIRT_MACHINE_TAGGED(major, minor, micro, tag) \ + * DEFINE_VIRT_MACHINE_IMPL(false, major, minor, micro, _, tag) + */ + +/* + * Helper for dispatching different macros based on how + * many __VA_ARGS__ are passed. Supports 1 to 5 variadic + * arguments, with the called target able to be prefixed + * with 0 or more fixed arguments too. To be called thus: + * + * _MACHINE_VER_PICK(__VA_ARGS, + * MACRO_MATCHING_5_ARGS, + * MACRO_MATCHING_4_ARGS, + * MACRO_MATCHING_3_ARGS, + * MACRO_MATCHING_2_ARGS, + * MACRO_MATCHING_1_ARG) (FIXED-ARG-1, + * ..., + * FIXED-ARG-N, + * __VA_ARGS__) + */ +#define _MACHINE_VER_PICK(x1, x2, x3, x4, x5, x6, ...) x6 + +/* + * Construct a human targeted machine version string. + * + * Can be invoked with various signatures + * + * MACHINE_VER_STR(sym, prefix, major, minor) + * MACHINE_VER_STR(sym, prefix, major, minor, micro) + * MACHINE_VER_STR(sym, prefix, major, minor, _, tag) + * MACHINE_VER_STR(sym, prefix, major, minor, micro, _, tag) + * + * Respectively emitting symbols with the format + * + * "{major}.{minor}" + * "{major}.{minor}-{tag}" + * "{major}.{minor}.{micro}" + * "{major}.{minor}.{micro}-{tag}" + */ +#define _MACHINE_VER_STR2(major, minor) \ + #major "." #minor + +#define _MACHINE_VER_STR3(major, minor, micro) \ + #major "." #minor "." #micro + +#define _MACHINE_VER_STR4(major, minor, _unused_, tag) \ + #major "." #minor "-" #tag + +#define _MACHINE_VER_STR5(major, minor, micro, _unused_, tag) \ + #major "." #minor "." #micro "-" #tag + +#define MACHINE_VER_STR(...) \ + _MACHINE_VER_PICK(__VA_ARGS__, \ + _MACHINE_VER_STR5, \ + _MACHINE_VER_STR4, \ + _MACHINE_VER_STR3, \ + _MACHINE_VER_STR2) (__VA_ARGS__) + + +/* + * Construct a QAPI type name for a versioned machine + * type + * + * Can be invoked with various signatures + * + * MACHINE_VER_TYPE_NAME(prefix, major, minor) + * MACHINE_VER_TYPE_NAME(prefix, major, minor, micro) + * MACHINE_VER_TYPE_NAME(prefix, major, minor, _, tag) + * MACHINE_VER_TYPE_NAME(prefix, major, minor, micro, _, tag) + * + * Respectively emitting symbols with the format + * + * "{prefix}-{major}.{minor}" + * "{prefix}-{major}.{minor}.{micro}" + * "{prefix}-{major}.{minor}-{tag}" + * "{prefix}-{major}.{minor}.{micro}-{tag}" + */ +#define _MACHINE_VER_TYPE_NAME2(prefix, major, minor) \ + prefix "-" #major "." #minor TYPE_MACHINE_SUFFIX + +#define _MACHINE_VER_TYPE_NAME3(prefix, major, minor, micro) \ + prefix "-" #major "." #minor "." #micro TYPE_MACHINE_SUFFIX + +#define _MACHINE_VER_TYPE_NAME4(prefix, major, minor, _unused_, tag) \ + prefix "-" #major "." #minor "-" #tag TYPE_MACHINE_SUFFIX + +#define _MACHINE_VER_TYPE_NAME5(prefix, major, minor, micro, _unused_, tag= ) \ + prefix "-" #major "." #minor "." #micro "-" #tag TYPE_MACHINE_SUFFIX + +#define MACHINE_VER_TYPE_NAME(prefix, ...) \ + _MACHINE_VER_PICK(__VA_ARGS__, \ + _MACHINE_VER_TYPE_NAME5, \ + _MACHINE_VER_TYPE_NAME4, \ + _MACHINE_VER_TYPE_NAME3, \ + _MACHINE_VER_TYPE_NAME2) (prefix, __VA_ARGS__) + +/* + * Construct a name for a versioned machine type that is + * suitable for use as a C symbol (function/variable/etc). + * + * Can be invoked with various signatures + * + * MACHINE_VER_SYM(sym, prefix, major, minor) + * MACHINE_VER_SYM(sym, prefix, major, minor, micro) + * MACHINE_VER_SYM(sym, prefix, major, minor, _, tag) + * MACHINE_VER_SYM(sym, prefix, major, minor, micro, _, tag) + * + * Respectively emitting symbols with the format + * + * {prefix}_machine_{major}_{minor}_{sym} + * {prefix}_machine_{major}_{minor}_{micro}_{sym} + * {prefix}_machine_{major}_{minor}_{tag}_{sym} + * {prefix}_machine_{major}_{minor}_{micro}_{tag}_{sym} + */ +#define _MACHINE_VER_SYM2(sym, prefix, major, minor) \ + prefix ## _machine_ ## major ## _ ## minor ## _ ## sym + +#define _MACHINE_VER_SYM3(sym, prefix, major, minor, micro) \ + prefix ## _machine_ ## major ## _ ## minor ## _ ## micro ## _ ## sym + +#define _MACHINE_VER_SYM4(sym, prefix, major, minor, _unused_, tag) \ + prefix ## _machine_ ## major ## _ ## minor ## _ ## tag ## _ ## sym + +#define _MACHINE_VER_SYM5(sym, prefix, major, minor, micro, _unused_, tag)= \ + prefix ## _machine_ ## major ## _ ## minor ## _ ## micro ## _ ## tag #= # _ ## sym + +#define MACHINE_VER_SYM(sym, prefix, ...) \ + _MACHINE_VER_PICK(__VA_ARGS__, \ + _MACHINE_VER_SYM5, \ + _MACHINE_VER_SYM4, \ + _MACHINE_VER_SYM3, \ + _MACHINE_VER_SYM2) (sym, prefix, __VA_ARGS__) + + #define DEFINE_MACHINE(namestr, machine_initfn) \ static void machine_initfn##_class_init(ObjectClass *oc, void *data) \ { \ --=20 2.43.0 From nobody Mon Nov 25 01:54:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1718902745; cv=none; d=zohomail.com; s=zohoarc; b=jNlG3xzF118gfiRtuap4YI/mDwmPnb5p0ku/NV00e9nNLr3bCRcydC8zA3aXsJbFDWDgKmoN3wy0uPpnmVPET0KtFZG397ZEgs+u/OeHErocV7lIkI17ow9M381VMvn72E0kfaDB6Bz5BTO/Iw4Fs8SaY53xjNNfirWF1YT7uGw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718902745; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=W26zUu3tzIuzLwn1cRO3MRqBR1pUCXsSQEhk0LfTWoM=; b=cGijMK5HIrs7ChTB541S1GJfbOOsudtvrHiIz8mA8Z6f9wcO/rJVJks1sxzOIH4MZcTOqDwcWugWJjmUP2iTieZUbEqXtERiDWl3N5kNEz1HA2lnMNiyRsRgYu5kao1x1bJNOJX6yty1q6BgbHdqiJGBxK3IefY/8di+8Fe/Ctc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1718902745305856.0489732930325; Thu, 20 Jun 2024 09:59:05 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKL7B-0005Xi-LH; Thu, 20 Jun 2024 12:58:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL79-0005WL-Pz for qemu-devel@nongnu.org; Thu, 20 Jun 2024 12:58:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL78-0000va-Co for qemu-devel@nongnu.org; Thu, 20 Jun 2024 12:58:23 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-70-nnqil8olNBWpHYhM9LHVmQ-1; Thu, 20 Jun 2024 12:58:18 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 2166C1956087; Thu, 20 Jun 2024 16:58:13 +0000 (UTC) Received: from toolbox.redhat.com (unknown [10.42.28.69]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0634D19560B0; Thu, 20 Jun 2024 16:58:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718902701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W26zUu3tzIuzLwn1cRO3MRqBR1pUCXsSQEhk0LfTWoM=; b=AU3zY1EKXuX4Qak5+gw1l37OPcxPK9xX2NGrdH66jHcF6LqJbbEMOdvPlVhwFDKllJURmr nw+pykoY1QHGllfBaqa+k5L8B5sMaLzBWTrxIyMQJIYDqdPkUJ/T/JcPtPmd+0+ahqG/n7 6dzLTOJGg7CDZUeF/bRm+M+ARqH8SKk= X-MC-Unique: nnqil8olNBWpHYhM9LHVmQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Halil Pasic , devel@lists.libvirt.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Eric Farman , qemu-s390x@nongnu.org, Richard Henderson , Nicholas Piggin , David Hildenbrand , Ilya Leoshkevich , David Gibson , qemu-arm@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora , Yanan Wang , Eduardo Habkost , Peter Maydell , Daniel Henrique Barboza , Thomas Huth , Paolo Bonzini , Marcel Apfelbaum , Christian Borntraeger , Laurent Vivier , qemu-ppc@nongnu.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 02/14] hw/arm: convert 'virt' machine definitions to use new macros Date: Thu, 20 Jun 2024 17:57:30 +0100 Message-ID: <20240620165742.1711389-3-berrange@redhat.com> In-Reply-To: <20240620165742.1711389-1-berrange@redhat.com> References: <20240620165742.1711389-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.152, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1718902746859100001 This changes the DEFINE_VIRT_MACHINE macro to use the common helpers for constructing versioned symbol names and strings, bringing greater consistency across targets. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/virt.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index c7a1f754e7..a326aa24db 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -101,33 +101,35 @@ static void arm_virt_compat_set(MachineClass *mc) arm_virt_compat_len); } =20 -#define DEFINE_VIRT_MACHINE_LATEST(major, minor, latest) \ - static void virt_##major##_##minor##_class_init(ObjectClass *oc, \ - void *data) \ +#define DEFINE_VIRT_MACHINE_IMPL(latest, ...) \ + static void MACHINE_VER_SYM(class_init, virt, __VA_ARGS__)( \ + ObjectClass *oc, \ + void *data) \ { \ MachineClass *mc =3D MACHINE_CLASS(oc); \ arm_virt_compat_set(mc); \ - virt_machine_##major##_##minor##_options(mc); \ - mc->desc =3D "QEMU " # major "." # minor " ARM Virtual Machine"; \ + MACHINE_VER_SYM(options, virt, __VA_ARGS__)(mc); \ + mc->desc =3D "QEMU " MACHINE_VER_STR(__VA_ARGS__) " ARM Virtual Ma= chine"; \ if (latest) { \ mc->alias =3D "virt"; \ } \ } \ - static const TypeInfo machvirt_##major##_##minor##_info =3D { \ - .name =3D MACHINE_TYPE_NAME("virt-" # major "." # minor), \ + static const TypeInfo MACHINE_VER_SYM(info, virt, __VA_ARGS__) =3D \ + { \ + .name =3D MACHINE_VER_TYPE_NAME("virt", __VA_ARGS__), \ .parent =3D TYPE_VIRT_MACHINE, \ - .class_init =3D virt_##major##_##minor##_class_init, \ + .class_init =3D MACHINE_VER_SYM(class_init, virt, __VA_ARGS__), \ }; \ - static void machvirt_machine_##major##_##minor##_init(void) \ + static void MACHINE_VER_SYM(register, virt, __VA_ARGS__)(void) \ { \ - type_register_static(&machvirt_##major##_##minor##_info); \ + type_register_static(&MACHINE_VER_SYM(info, virt, __VA_ARGS__)); \ } \ - type_init(machvirt_machine_##major##_##minor##_init); + type_init(MACHINE_VER_SYM(register, virt, __VA_ARGS__)); =20 #define DEFINE_VIRT_MACHINE_AS_LATEST(major, minor) \ - DEFINE_VIRT_MACHINE_LATEST(major, minor, true) + DEFINE_VIRT_MACHINE_IMPL(true, major, minor) #define DEFINE_VIRT_MACHINE(major, minor) \ - DEFINE_VIRT_MACHINE_LATEST(major, minor, false) + DEFINE_VIRT_MACHINE_IMPL(false, major, minor) =20 =20 /* Number of external interrupt lines to configure the GIC with */ --=20 2.43.0 From nobody Mon Nov 25 01:54:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1718902762; cv=none; d=zohomail.com; s=zohoarc; b=QSPVnzI0lp22524AdTpY5FfUA+DcvITdAuwKixHZlPXOKlDrVecdJM3DRl21//1AxS1cbxhx/QjJO/xcrd00bndni6sQ7pHxf6zjL7vMlX1hL1nflxalzgQgejf6h68w2IFvplIZNDy2EbRADP/q2oKRH89JWhxMsWuxib/KhP0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718902762; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cNzNYawQLjHz5Qc9d7+ukYddQ2aoH2I1BuC6q69D6Cg=; b=lWdiK+fCJLprf0m7EpndTp0cUOs3qLPHddIFaSzhOdT8fEXPIvQ/ImRPSlw9GZPP+U5llKyJchC2mMU0oqsn+iJZgNBzPDZRwTeRmcpJfQByvxpm56GeKobHRuSvXZervOuZNHrz7+zv2Z8aLxs9m68x9+Gl6Oe7FWPm9qq7H7U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1718902762889346.020753139023; Thu, 20 Jun 2024 09:59:22 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKL7O-0005hd-KY; Thu, 20 Jun 2024 12:58:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL7L-0005dm-Pq for qemu-devel@nongnu.org; Thu, 20 Jun 2024 12:58:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL7J-0000yY-Nm for qemu-devel@nongnu.org; Thu, 20 Jun 2024 12:58:35 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-2-z-15_16vOqSe30KVMUtR8A-1; Thu, 20 Jun 2024 12:58:25 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A9B2D19560B2; Thu, 20 Jun 2024 16:58:20 +0000 (UTC) Received: from toolbox.redhat.com (unknown [10.42.28.69]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id AD4FF19560B4; Thu, 20 Jun 2024 16:58:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718902713; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cNzNYawQLjHz5Qc9d7+ukYddQ2aoH2I1BuC6q69D6Cg=; b=gt4U3BDHr7nlYWVFM5IWBddekPcTnHEzmOpdzZrO2iYKrExur4TEelzb1UxtHmPZi3RdGD fU9gOVmbDa+73u6zX6/99QfihuRJbsLxk2KdHpndeTYGT4C6l+ivFDXn+LaiE+QS1vCjsS +FZJX/FsiGA2J7Tkn8OB0XyMuojUN7s= X-MC-Unique: z-15_16vOqSe30KVMUtR8A-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Halil Pasic , devel@lists.libvirt.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Eric Farman , qemu-s390x@nongnu.org, Richard Henderson , Nicholas Piggin , David Hildenbrand , Ilya Leoshkevich , David Gibson , qemu-arm@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora , Yanan Wang , Eduardo Habkost , Peter Maydell , Daniel Henrique Barboza , Thomas Huth , Paolo Bonzini , Marcel Apfelbaum , Christian Borntraeger , Laurent Vivier , qemu-ppc@nongnu.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 03/14] hw/s390x: convert 'ccw' machine definitions to use new macros Date: Thu, 20 Jun 2024 17:57:31 +0100 Message-ID: <20240620165742.1711389-4-berrange@redhat.com> In-Reply-To: <20240620165742.1711389-1-berrange@redhat.com> References: <20240620165742.1711389-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.152, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1718902765026100005 This changes the DEFINE_CCW_MACHINE macro to use the common helpers for constructing versioned symbol names and strings, bringing greater consistency across targets. The added benefit is that it avoids the need to repeat the version number twice in two different formats in the calls to DEFINE_CCW_MACHINE. A DEFINE_CCW_MACHINE_AS_LATEST helper is added so that it is not required to pass 'false' for every single historical machine type. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/s390x/s390-virtio-ccw.c | 96 +++++++++++++++++++++----------------- 1 file changed, 53 insertions(+), 43 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 3d0bc3e7f2..efed539bc6 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -15,6 +15,7 @@ #include "qapi/error.h" #include "exec/ram_addr.h" #include "exec/confidential-guest-support.h" +#include "hw/boards.h" #include "hw/s390x/s390-virtio-hcall.h" #include "hw/s390x/sclp.h" #include "hw/s390x/s390_flic.h" @@ -816,35 +817,44 @@ static const TypeInfo ccw_machine_info =3D { }, }; =20 -#define DEFINE_CCW_MACHINE(suffix, verstr, latest) = \ - static void ccw_machine_##suffix##_class_init(ObjectClass *oc, = \ - void *data) = \ +#define DEFINE_CCW_MACHINE_IMPL(latest, ...) = \ + static void MACHINE_VER_SYM(class_init, ccw, __VA_ARGS__)( = \ + ObjectClass *oc, = \ + void *data) = \ { = \ MachineClass *mc =3D MACHINE_CLASS(oc); = \ - ccw_machine_##suffix##_class_options(mc); = \ - mc->desc =3D "Virtual s390x machine (version " verstr ")"; = \ + MACHINE_VER_SYM(class_options, ccw, __VA_ARGS__)(mc); = \ + mc->desc =3D "Virtual s390x machine (version " MACHINE_VER_STR(__V= A_ARGS__) ")"; \ if (latest) { = \ mc->alias =3D "s390-ccw-virtio"; = \ mc->is_default =3D true; = \ } = \ } = \ - static void ccw_machine_##suffix##_instance_init(Object *obj) = \ + static void MACHINE_VER_SYM(instance_init, ccw, __VA_ARGS__)(Object *o= bj) \ { = \ MachineState *machine =3D MACHINE(obj); = \ - current_mc =3D S390_CCW_MACHINE_CLASS(MACHINE_GET_CLASS(machine));= \ - ccw_machine_##suffix##_instance_options(machine); = \ + current_mc =3D S390_CCW_MACHINE_CLASS(MACHINE_GET_CLASS(machine));= \ + MACHINE_VER_SYM(instance_options, ccw, __VA_ARGS__)(machine); = \ } = \ - static const TypeInfo ccw_machine_##suffix##_info =3D { = \ - .name =3D MACHINE_TYPE_NAME("s390-ccw-virtio-" verstr), = \ + static const TypeInfo MACHINE_VER_SYM(info, ccw, __VA_ARGS__) =3D = \ + { = \ + .name =3D MACHINE_VER_TYPE_NAME("s390-ccw-virtio", __VA_ARGS__), = \ .parent =3D TYPE_S390_CCW_MACHINE, = \ - .class_init =3D ccw_machine_##suffix##_class_init, = \ - .instance_init =3D ccw_machine_##suffix##_instance_init, = \ + .class_init =3D MACHINE_VER_SYM(class_init, ccw, __VA_ARGS__), = \ + .instance_init =3D MACHINE_VER_SYM(instance_init, ccw, __VA_ARGS__= ), \ }; = \ - static void ccw_machine_register_##suffix(void) = \ + static void MACHINE_VER_SYM(register, ccw, __VA_ARGS__)(void) = \ { = \ - type_register_static(&ccw_machine_##suffix##_info); = \ + type_register_static(&MACHINE_VER_SYM(info, ccw, __VA_ARGS__)); = \ } = \ - type_init(ccw_machine_register_##suffix) + type_init(MACHINE_VER_SYM(register, ccw, __VA_ARGS__)) + +#define DEFINE_CCW_MACHINE_AS_LATEST(major, minor) \ + DEFINE_CCW_MACHINE_IMPL(true, major, minor) + +#define DEFINE_CCW_MACHINE(major, minor) \ + DEFINE_CCW_MACHINE_IMPL(false, major, minor) + =20 static void ccw_machine_9_1_instance_options(MachineState *machine) { @@ -853,7 +863,7 @@ static void ccw_machine_9_1_instance_options(MachineSta= te *machine) static void ccw_machine_9_1_class_options(MachineClass *mc) { } -DEFINE_CCW_MACHINE(9_1, "9.1", true); +DEFINE_CCW_MACHINE_AS_LATEST(9, 1); =20 static void ccw_machine_9_0_instance_options(MachineState *machine) { @@ -865,7 +875,7 @@ static void ccw_machine_9_0_class_options(MachineClass = *mc) ccw_machine_9_1_class_options(mc); compat_props_add(mc->compat_props, hw_compat_9_0, hw_compat_9_0_len); } -DEFINE_CCW_MACHINE(9_0, "9.0", false); +DEFINE_CCW_MACHINE(9, 0); =20 static void ccw_machine_8_2_instance_options(MachineState *machine) { @@ -877,7 +887,7 @@ static void ccw_machine_8_2_class_options(MachineClass = *mc) ccw_machine_9_0_class_options(mc); compat_props_add(mc->compat_props, hw_compat_8_2, hw_compat_8_2_len); } -DEFINE_CCW_MACHINE(8_2, "8.2", false); +DEFINE_CCW_MACHINE(8, 2); =20 static void ccw_machine_8_1_instance_options(MachineState *machine) { @@ -891,7 +901,7 @@ static void ccw_machine_8_1_class_options(MachineClass = *mc) mc->smp_props.drawers_supported =3D false; mc->smp_props.books_supported =3D false; } -DEFINE_CCW_MACHINE(8_1, "8.1", false); +DEFINE_CCW_MACHINE(8, 1); =20 static void ccw_machine_8_0_instance_options(MachineState *machine) { @@ -903,7 +913,7 @@ static void ccw_machine_8_0_class_options(MachineClass = *mc) ccw_machine_8_1_class_options(mc); compat_props_add(mc->compat_props, hw_compat_8_0, hw_compat_8_0_len); } -DEFINE_CCW_MACHINE(8_0, "8.0", false); +DEFINE_CCW_MACHINE(8, 0); =20 static void ccw_machine_7_2_instance_options(MachineState *machine) { @@ -915,7 +925,7 @@ static void ccw_machine_7_2_class_options(MachineClass = *mc) ccw_machine_8_0_class_options(mc); compat_props_add(mc->compat_props, hw_compat_7_2, hw_compat_7_2_len); } -DEFINE_CCW_MACHINE(7_2, "7.2", false); +DEFINE_CCW_MACHINE(7, 2); =20 static void ccw_machine_7_1_instance_options(MachineState *machine) { @@ -939,7 +949,7 @@ static void ccw_machine_7_1_class_options(MachineClass = *mc) compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); s390mc->max_threads =3D S390_MAX_CPUS; } -DEFINE_CCW_MACHINE(7_1, "7.1", false); +DEFINE_CCW_MACHINE(7, 1); =20 static void ccw_machine_7_0_instance_options(MachineState *machine) { @@ -954,7 +964,7 @@ static void ccw_machine_7_0_class_options(MachineClass = *mc) ccw_machine_7_1_class_options(mc); compat_props_add(mc->compat_props, hw_compat_7_0, hw_compat_7_0_len); } -DEFINE_CCW_MACHINE(7_0, "7.0", false); +DEFINE_CCW_MACHINE(7, 0); =20 static void ccw_machine_6_2_instance_options(MachineState *machine) { @@ -969,7 +979,7 @@ static void ccw_machine_6_2_class_options(MachineClass = *mc) ccw_machine_7_0_class_options(mc); compat_props_add(mc->compat_props, hw_compat_6_2, hw_compat_6_2_len); } -DEFINE_CCW_MACHINE(6_2, "6.2", false); +DEFINE_CCW_MACHINE(6, 2); =20 static void ccw_machine_6_1_instance_options(MachineState *machine) { @@ -987,7 +997,7 @@ static void ccw_machine_6_1_class_options(MachineClass = *mc) compat_props_add(mc->compat_props, hw_compat_6_1, hw_compat_6_1_len); mc->smp_props.prefer_sockets =3D true; } -DEFINE_CCW_MACHINE(6_1, "6.1", false); +DEFINE_CCW_MACHINE(6, 1); =20 static void ccw_machine_6_0_instance_options(MachineState *machine) { @@ -1002,7 +1012,7 @@ static void ccw_machine_6_0_class_options(MachineClas= s *mc) ccw_machine_6_1_class_options(mc); compat_props_add(mc->compat_props, hw_compat_6_0, hw_compat_6_0_len); } -DEFINE_CCW_MACHINE(6_0, "6.0", false); +DEFINE_CCW_MACHINE(6, 0); =20 static void ccw_machine_5_2_instance_options(MachineState *machine) { @@ -1014,7 +1024,7 @@ static void ccw_machine_5_2_class_options(MachineClas= s *mc) ccw_machine_6_0_class_options(mc); compat_props_add(mc->compat_props, hw_compat_5_2, hw_compat_5_2_len); } -DEFINE_CCW_MACHINE(5_2, "5.2", false); +DEFINE_CCW_MACHINE(5, 2); =20 static void ccw_machine_5_1_instance_options(MachineState *machine) { @@ -1026,7 +1036,7 @@ static void ccw_machine_5_1_class_options(MachineClas= s *mc) ccw_machine_5_2_class_options(mc); compat_props_add(mc->compat_props, hw_compat_5_1, hw_compat_5_1_len); } -DEFINE_CCW_MACHINE(5_1, "5.1", false); +DEFINE_CCW_MACHINE(5, 1); =20 static void ccw_machine_5_0_instance_options(MachineState *machine) { @@ -1038,7 +1048,7 @@ static void ccw_machine_5_0_class_options(MachineClas= s *mc) ccw_machine_5_1_class_options(mc); compat_props_add(mc->compat_props, hw_compat_5_0, hw_compat_5_0_len); } -DEFINE_CCW_MACHINE(5_0, "5.0", false); +DEFINE_CCW_MACHINE(5, 0); =20 static void ccw_machine_4_2_instance_options(MachineState *machine) { @@ -1051,7 +1061,7 @@ static void ccw_machine_4_2_class_options(MachineClas= s *mc) mc->fixup_ram_size =3D s390_fixup_ram_size; compat_props_add(mc->compat_props, hw_compat_4_2, hw_compat_4_2_len); } -DEFINE_CCW_MACHINE(4_2, "4.2", false); +DEFINE_CCW_MACHINE(4, 2); =20 static void ccw_machine_4_1_instance_options(MachineState *machine) { @@ -1065,7 +1075,7 @@ static void ccw_machine_4_1_class_options(MachineClas= s *mc) ccw_machine_4_2_class_options(mc); compat_props_add(mc->compat_props, hw_compat_4_1, hw_compat_4_1_len); } -DEFINE_CCW_MACHINE(4_1, "4.1", false); +DEFINE_CCW_MACHINE(4, 1); =20 static void ccw_machine_4_0_instance_options(MachineState *machine) { @@ -1079,7 +1089,7 @@ static void ccw_machine_4_0_class_options(MachineClas= s *mc) ccw_machine_4_1_class_options(mc); compat_props_add(mc->compat_props, hw_compat_4_0, hw_compat_4_0_len); } -DEFINE_CCW_MACHINE(4_0, "4.0", false); +DEFINE_CCW_MACHINE(4, 0); =20 static void ccw_machine_3_1_instance_options(MachineState *machine) { @@ -1095,7 +1105,7 @@ static void ccw_machine_3_1_class_options(MachineClas= s *mc) ccw_machine_4_0_class_options(mc); compat_props_add(mc->compat_props, hw_compat_3_1, hw_compat_3_1_len); } -DEFINE_CCW_MACHINE(3_1, "3.1", false); +DEFINE_CCW_MACHINE(3, 1); =20 static void ccw_machine_3_0_instance_options(MachineState *machine) { @@ -1110,7 +1120,7 @@ static void ccw_machine_3_0_class_options(MachineClas= s *mc) ccw_machine_3_1_class_options(mc); compat_props_add(mc->compat_props, hw_compat_3_0, hw_compat_3_0_len); } -DEFINE_CCW_MACHINE(3_0, "3.0", false); +DEFINE_CCW_MACHINE(3, 0); =20 static void ccw_machine_2_12_instance_options(MachineState *machine) { @@ -1124,7 +1134,7 @@ static void ccw_machine_2_12_class_options(MachineCla= ss *mc) ccw_machine_3_0_class_options(mc); compat_props_add(mc->compat_props, hw_compat_2_12, hw_compat_2_12_len); } -DEFINE_CCW_MACHINE(2_12, "2.12", false); +DEFINE_CCW_MACHINE(2, 12); =20 static void ccw_machine_2_11_instance_options(MachineState *machine) { @@ -1145,7 +1155,7 @@ static void ccw_machine_2_11_class_options(MachineCla= ss *mc) compat_props_add(mc->compat_props, hw_compat_2_11, hw_compat_2_11_len); compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } -DEFINE_CCW_MACHINE(2_11, "2.11", false); +DEFINE_CCW_MACHINE(2, 11); =20 static void ccw_machine_2_10_instance_options(MachineState *machine) { @@ -1157,7 +1167,7 @@ static void ccw_machine_2_10_class_options(MachineCla= ss *mc) ccw_machine_2_11_class_options(mc); compat_props_add(mc->compat_props, hw_compat_2_10, hw_compat_2_10_len); } -DEFINE_CCW_MACHINE(2_10, "2.10", false); +DEFINE_CCW_MACHINE(2, 10); =20 static void ccw_machine_2_9_instance_options(MachineState *machine) { @@ -1181,7 +1191,7 @@ static void ccw_machine_2_9_class_options(MachineClas= s *mc) compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); css_migration_enabled =3D false; } -DEFINE_CCW_MACHINE(2_9, "2.9", false); +DEFINE_CCW_MACHINE(2, 9); =20 static void ccw_machine_2_8_instance_options(MachineState *machine) { @@ -1198,7 +1208,7 @@ static void ccw_machine_2_8_class_options(MachineClas= s *mc) compat_props_add(mc->compat_props, hw_compat_2_8, hw_compat_2_8_len); compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } -DEFINE_CCW_MACHINE(2_8, "2.8", false); +DEFINE_CCW_MACHINE(2, 8); =20 static void ccw_machine_2_7_instance_options(MachineState *machine) { @@ -1213,7 +1223,7 @@ static void ccw_machine_2_7_class_options(MachineClas= s *mc) ccw_machine_2_8_class_options(mc); compat_props_add(mc->compat_props, hw_compat_2_7, hw_compat_2_7_len); } -DEFINE_CCW_MACHINE(2_7, "2.7", false); +DEFINE_CCW_MACHINE(2, 7); =20 static void ccw_machine_2_6_instance_options(MachineState *machine) { @@ -1233,7 +1243,7 @@ static void ccw_machine_2_6_class_options(MachineClas= s *mc) compat_props_add(mc->compat_props, hw_compat_2_6, hw_compat_2_6_len); compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } -DEFINE_CCW_MACHINE(2_6, "2.6", false); +DEFINE_CCW_MACHINE(2, 6); =20 static void ccw_machine_2_5_instance_options(MachineState *machine) { @@ -1245,7 +1255,7 @@ static void ccw_machine_2_5_class_options(MachineClas= s *mc) ccw_machine_2_6_class_options(mc); compat_props_add(mc->compat_props, hw_compat_2_5, hw_compat_2_5_len); } -DEFINE_CCW_MACHINE(2_5, "2.5", false); +DEFINE_CCW_MACHINE(2, 5); =20 static void ccw_machine_2_4_instance_options(MachineState *machine) { @@ -1270,7 +1280,7 @@ static void ccw_machine_2_4_class_options(MachineClas= s *mc) compat_props_add(mc->compat_props, hw_compat_2_4, hw_compat_2_4_len); compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } -DEFINE_CCW_MACHINE(2_4, "2.4", false); +DEFINE_CCW_MACHINE(2, 4); =20 static void ccw_machine_register_types(void) { --=20 2.43.0 From nobody Mon Nov 25 01:54:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1718902796; cv=none; d=zohomail.com; s=zohoarc; b=A1N1g4yxRvespiyjLY0tlyQcKo82WfhY0zUTCtBhxhYY1sv3mdMyHzWO9hbQIBVqTbHVsLCGA7ErUGboVtQy0X/wBoAl5eSPw3W8ViDsblHA/SegTZAQ+3vWVTYpkZp/EXM/IFlPeO6x+RKdKu0/GIVYAtMWnU+nc6DH7uKIdWw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718902796; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=da+1g8RCT3MulFudIFxm/lqkfEagvGzmu1D2Ju52kvk=; b=fnrBsygzzpAt0hvvlcb8a/9cXhYL826LNgtJw9Czbr4vMxc//URkWTd2vF9bKq4H+/hrYk9QUzKbfcEcNGrs93806ZPP61p6qrKK+BjsaF2mBBErKxgwieYhAYbVoQ7OsFt0XOGttEOa/OsBw5gdBaWTqicRvXogJ/6rwlUoX3E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17189027959432.6256230954307966; Thu, 20 Jun 2024 09:59:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKL7S-0005oC-5d; Thu, 20 Jun 2024 12:58:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL7O-0005id-QM for qemu-devel@nongnu.org; Thu, 20 Jun 2024 12:58:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL7M-0000yw-Kb for qemu-devel@nongnu.org; Thu, 20 Jun 2024 12:58:38 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-74-BvRZSjlrPK6a9T1e2XUmVQ-1; Thu, 20 Jun 2024 12:58:32 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 64C9719560A0; Thu, 20 Jun 2024 16:58:29 +0000 (UTC) Received: from toolbox.redhat.com (unknown [10.42.28.69]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3868019560AF; Thu, 20 Jun 2024 16:58:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718902716; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=da+1g8RCT3MulFudIFxm/lqkfEagvGzmu1D2Ju52kvk=; b=iR2Y997Rjbec2Wmk1P5c30ZCWFsCJt89t+LG8zBODm/ho22xSqLqEC4CAS1H0muCPRhnEp xMQ1nSIlkFuOmSx7OBTLJ4ve8O+zuU4wJM4ub9mmfU73YQPAJnDn6wJSe1JDHqtFmC6XB1 C2a/8LS6o18kBroIw3Jhzum+UMygEBE= X-MC-Unique: BvRZSjlrPK6a9T1e2XUmVQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Halil Pasic , devel@lists.libvirt.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Eric Farman , qemu-s390x@nongnu.org, Richard Henderson , Nicholas Piggin , David Hildenbrand , Ilya Leoshkevich , David Gibson , qemu-arm@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora , Yanan Wang , Eduardo Habkost , Peter Maydell , Daniel Henrique Barboza , Thomas Huth , Paolo Bonzini , Marcel Apfelbaum , Christian Borntraeger , Laurent Vivier , qemu-ppc@nongnu.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 04/14] hw/ppc: convert 'spapr' machine definitions to use new macros Date: Thu, 20 Jun 2024 17:57:32 +0100 Message-ID: <20240620165742.1711389-5-berrange@redhat.com> In-Reply-To: <20240620165742.1711389-1-berrange@redhat.com> References: <20240620165742.1711389-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.152, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1718902797106100001 This changes the DEFINE_SPAPR_MACHINE macro to use the common helpers for constructing versioned symbol names and strings, bringing greater consistency across targets. The added benefit is that it avoids the need to repeat the version number twice in two different formats in the calls to DEFINE_SPAPR_MACHINE. A DEFINE_SPAPR_MACHINE_AS_LATEST helper is added so that it is not required to pass 'false' for every single historical machine type. Due to the odd-ball '2.12-sxxm' machine type version, this commit introduces a DEFINE_SPAPR_MACHINE_TAGGED helper to allow defining of "tagged" machine types which have a string suffix. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrang=C3=A9 --- hw/ppc/spapr.c | 93 +++++++++++++++++++++++++++----------------------- 1 file changed, 51 insertions(+), 42 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index a9908545e6..2785b6b303 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4804,26 +4804,35 @@ static void spapr_machine_latest_class_options(Mach= ineClass *mc) mc->is_default =3D true; } =20 -#define DEFINE_SPAPR_MACHINE(suffix, verstr, latest) \ - static void spapr_machine_##suffix##_class_init(ObjectClass *oc, \ - void *data) \ +#define DEFINE_SPAPR_MACHINE_IMPL(latest, ...) \ + static void MACHINE_VER_SYM(class_init, spapr, __VA_ARGS__)( \ + ObjectClass *oc, \ + void *data) \ { \ MachineClass *mc =3D MACHINE_CLASS(oc); \ - spapr_machine_##suffix##_class_options(mc); \ + MACHINE_VER_SYM(class_options, spapr, __VA_ARGS__)(mc); \ if (latest) { \ spapr_machine_latest_class_options(mc); \ } \ } \ - static const TypeInfo spapr_machine_##suffix##_info =3D { \ - .name =3D MACHINE_TYPE_NAME("pseries-" verstr), \ + static const TypeInfo MACHINE_VER_SYM(info, spapr, __VA_ARGS__) =3D \ + { \ + .name =3D MACHINE_VER_TYPE_NAME("pseries", __VA_ARGS__), \ .parent =3D TYPE_SPAPR_MACHINE, \ - .class_init =3D spapr_machine_##suffix##_class_init, \ + .class_init =3D MACHINE_VER_SYM(class_init, spapr, __VA_ARGS__), \ }; \ - static void spapr_machine_register_##suffix(void) \ + static void MACHINE_VER_SYM(register, spapr, __VA_ARGS__)(void) \ { \ - type_register(&spapr_machine_##suffix##_info); \ + type_register(&MACHINE_VER_SYM(info, spapr, __VA_ARGS__)); \ } \ - type_init(spapr_machine_register_##suffix) + type_init(MACHINE_VER_SYM(register, spapr, __VA_ARGS__)) + +#define DEFINE_SPAPR_MACHINE_AS_LATEST(major, minor) \ + DEFINE_SPAPR_MACHINE_IMPL(true, major, minor) +#define DEFINE_SPAPR_MACHINE(major, minor) \ + DEFINE_SPAPR_MACHINE_IMPL(false, major, minor) +#define DEFINE_SPAPR_MACHINE_TAGGED(major, minor, tag) \ + DEFINE_SPAPR_MACHINE_IMPL(false, major, minor, _, tag) =20 /* * pseries-9.1 @@ -4833,7 +4842,7 @@ static void spapr_machine_9_1_class_options(MachineCl= ass *mc) /* Defaults for the latest behaviour inherited from the base class */ } =20 -DEFINE_SPAPR_MACHINE(9_1, "9.1", true); +DEFINE_SPAPR_MACHINE_AS_LATEST(9, 1); =20 /* * pseries-9.0 @@ -4844,7 +4853,7 @@ static void spapr_machine_9_0_class_options(MachineCl= ass *mc) compat_props_add(mc->compat_props, hw_compat_9_0, hw_compat_9_0_len); } =20 -DEFINE_SPAPR_MACHINE(9_0, "9.0", false); +DEFINE_SPAPR_MACHINE(9, 0); =20 /* * pseries-8.2 @@ -4855,7 +4864,7 @@ static void spapr_machine_8_2_class_options(MachineCl= ass *mc) compat_props_add(mc->compat_props, hw_compat_8_2, hw_compat_8_2_len); } =20 -DEFINE_SPAPR_MACHINE(8_2, "8.2", false); +DEFINE_SPAPR_MACHINE(8, 2); =20 /* * pseries-8.1 @@ -4866,7 +4875,7 @@ static void spapr_machine_8_1_class_options(MachineCl= ass *mc) compat_props_add(mc->compat_props, hw_compat_8_1, hw_compat_8_1_len); } =20 -DEFINE_SPAPR_MACHINE(8_1, "8.1", false); +DEFINE_SPAPR_MACHINE(8, 1); =20 /* * pseries-8.0 @@ -4877,7 +4886,7 @@ static void spapr_machine_8_0_class_options(MachineCl= ass *mc) compat_props_add(mc->compat_props, hw_compat_8_0, hw_compat_8_0_len); } =20 -DEFINE_SPAPR_MACHINE(8_0, "8.0", false); +DEFINE_SPAPR_MACHINE(8, 0); =20 /* * pseries-7.2 @@ -4888,7 +4897,7 @@ static void spapr_machine_7_2_class_options(MachineCl= ass *mc) compat_props_add(mc->compat_props, hw_compat_7_2, hw_compat_7_2_len); } =20 -DEFINE_SPAPR_MACHINE(7_2, "7.2", false); +DEFINE_SPAPR_MACHINE(7, 2); =20 /* * pseries-7.1 @@ -4899,7 +4908,7 @@ static void spapr_machine_7_1_class_options(MachineCl= ass *mc) compat_props_add(mc->compat_props, hw_compat_7_1, hw_compat_7_1_len); } =20 -DEFINE_SPAPR_MACHINE(7_1, "7.1", false); +DEFINE_SPAPR_MACHINE(7, 1); =20 /* * pseries-7.0 @@ -4910,7 +4919,7 @@ static void spapr_machine_7_0_class_options(MachineCl= ass *mc) compat_props_add(mc->compat_props, hw_compat_7_0, hw_compat_7_0_len); } =20 -DEFINE_SPAPR_MACHINE(7_0, "7.0", false); +DEFINE_SPAPR_MACHINE(7, 0); =20 /* * pseries-6.2 @@ -4921,7 +4930,7 @@ static void spapr_machine_6_2_class_options(MachineCl= ass *mc) compat_props_add(mc->compat_props, hw_compat_6_2, hw_compat_6_2_len); } =20 -DEFINE_SPAPR_MACHINE(6_2, "6.2", false); +DEFINE_SPAPR_MACHINE(6, 2); =20 /* * pseries-6.1 @@ -4936,7 +4945,7 @@ static void spapr_machine_6_1_class_options(MachineCl= ass *mc) mc->smp_props.prefer_sockets =3D true; } =20 -DEFINE_SPAPR_MACHINE(6_1, "6.1", false); +DEFINE_SPAPR_MACHINE(6, 1); =20 /* * pseries-6.0 @@ -4947,7 +4956,7 @@ static void spapr_machine_6_0_class_options(MachineCl= ass *mc) compat_props_add(mc->compat_props, hw_compat_6_0, hw_compat_6_0_len); } =20 -DEFINE_SPAPR_MACHINE(6_0, "6.0", false); +DEFINE_SPAPR_MACHINE(6, 0); =20 /* * pseries-5.2 @@ -4958,7 +4967,7 @@ static void spapr_machine_5_2_class_options(MachineCl= ass *mc) compat_props_add(mc->compat_props, hw_compat_5_2, hw_compat_5_2_len); } =20 -DEFINE_SPAPR_MACHINE(5_2, "5.2", false); +DEFINE_SPAPR_MACHINE(5, 2); =20 /* * pseries-5.1 @@ -4972,7 +4981,7 @@ static void spapr_machine_5_1_class_options(MachineCl= ass *mc) smc->pre_5_2_numa_associativity =3D true; } =20 -DEFINE_SPAPR_MACHINE(5_1, "5.1", false); +DEFINE_SPAPR_MACHINE(5, 1); =20 /* * pseries-5.0 @@ -4991,7 +5000,7 @@ static void spapr_machine_5_0_class_options(MachineCl= ass *mc) smc->pre_5_1_assoc_refpoints =3D true; } =20 -DEFINE_SPAPR_MACHINE(5_0, "5.0", false); +DEFINE_SPAPR_MACHINE(5, 0); =20 /* * pseries-4.2 @@ -5008,7 +5017,7 @@ static void spapr_machine_4_2_class_options(MachineCl= ass *mc) mc->nvdimm_supported =3D false; } =20 -DEFINE_SPAPR_MACHINE(4_2, "4.2", false); +DEFINE_SPAPR_MACHINE(4, 2); =20 /* * pseries-4.1 @@ -5028,7 +5037,7 @@ static void spapr_machine_4_1_class_options(MachineCl= ass *mc) compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } =20 -DEFINE_SPAPR_MACHINE(4_1, "4.1", false); +DEFINE_SPAPR_MACHINE(4, 1); =20 /* * pseries-4.0 @@ -5055,7 +5064,7 @@ static void spapr_machine_4_0_class_options(MachineCl= ass *mc) smc->pre_4_1_migration =3D true; } =20 -DEFINE_SPAPR_MACHINE(4_0, "4.0", false); +DEFINE_SPAPR_MACHINE(4, 0); =20 /* * pseries-3.1 @@ -5077,7 +5086,7 @@ static void spapr_machine_3_1_class_options(MachineCl= ass *mc) smc->default_caps.caps[SPAPR_CAP_LARGE_DECREMENTER] =3D SPAPR_CAP_OFF; } =20 -DEFINE_SPAPR_MACHINE(3_1, "3.1", false); +DEFINE_SPAPR_MACHINE(3, 1); =20 /* * pseries-3.0 @@ -5095,7 +5104,7 @@ static void spapr_machine_3_0_class_options(MachineCl= ass *mc) smc->irq =3D &spapr_irq_xics_legacy; } =20 -DEFINE_SPAPR_MACHINE(3_0, "3.0", false); +DEFINE_SPAPR_MACHINE(3, 0); =20 /* * pseries-2.12 @@ -5120,7 +5129,7 @@ static void spapr_machine_2_12_class_options(MachineC= lass *mc) smc->default_caps.caps[SPAPR_CAP_HPT_MAXPAGESIZE] =3D 0; } =20 -DEFINE_SPAPR_MACHINE(2_12, "2.12", false); +DEFINE_SPAPR_MACHINE(2, 12); =20 static void spapr_machine_2_12_sxxm_class_options(MachineClass *mc) { @@ -5132,7 +5141,7 @@ static void spapr_machine_2_12_sxxm_class_options(Mac= hineClass *mc) smc->default_caps.caps[SPAPR_CAP_IBS] =3D SPAPR_CAP_FIXED_CCD; } =20 -DEFINE_SPAPR_MACHINE(2_12_sxxm, "2.12-sxxm", false); +DEFINE_SPAPR_MACHINE_TAGGED(2, 12, sxxm); =20 /* * pseries-2.11 @@ -5148,7 +5157,7 @@ static void spapr_machine_2_11_class_options(MachineC= lass *mc) mc->deprecation_reason =3D "old and not maintained - use a 2.12+ versi= on"; } =20 -DEFINE_SPAPR_MACHINE(2_11, "2.11", false); +DEFINE_SPAPR_MACHINE(2, 11); =20 /* * pseries-2.10 @@ -5160,7 +5169,7 @@ static void spapr_machine_2_10_class_options(MachineC= lass *mc) compat_props_add(mc->compat_props, hw_compat_2_10, hw_compat_2_10_len); } =20 -DEFINE_SPAPR_MACHINE(2_10, "2.10", false); +DEFINE_SPAPR_MACHINE(2, 10); =20 /* * pseries-2.9 @@ -5180,7 +5189,7 @@ static void spapr_machine_2_9_class_options(MachineCl= ass *mc) smc->resize_hpt_default =3D SPAPR_RESIZE_HPT_DISABLED; } =20 -DEFINE_SPAPR_MACHINE(2_9, "2.9", false); +DEFINE_SPAPR_MACHINE(2, 9); =20 /* * pseries-2.8 @@ -5198,7 +5207,7 @@ static void spapr_machine_2_8_class_options(MachineCl= ass *mc) mc->numa_mem_align_shift =3D 23; } =20 -DEFINE_SPAPR_MACHINE(2_8, "2.8", false); +DEFINE_SPAPR_MACHINE(2, 8); =20 /* * pseries-2.7 @@ -5273,7 +5282,7 @@ static void spapr_machine_2_7_class_options(MachineCl= ass *mc) smc->phb_placement =3D phb_placement_2_7; } =20 -DEFINE_SPAPR_MACHINE(2_7, "2.7", false); +DEFINE_SPAPR_MACHINE(2, 7); =20 /* * pseries-2.6 @@ -5291,7 +5300,7 @@ static void spapr_machine_2_6_class_options(MachineCl= ass *mc) compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } =20 -DEFINE_SPAPR_MACHINE(2_6, "2.6", false); +DEFINE_SPAPR_MACHINE(2, 6); =20 /* * pseries-2.5 @@ -5310,7 +5319,7 @@ static void spapr_machine_2_5_class_options(MachineCl= ass *mc) compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } =20 -DEFINE_SPAPR_MACHINE(2_5, "2.5", false); +DEFINE_SPAPR_MACHINE(2, 5); =20 /* * pseries-2.4 @@ -5325,7 +5334,7 @@ static void spapr_machine_2_4_class_options(MachineCl= ass *mc) compat_props_add(mc->compat_props, hw_compat_2_4, hw_compat_2_4_len); } =20 -DEFINE_SPAPR_MACHINE(2_4, "2.4", false); +DEFINE_SPAPR_MACHINE(2, 4); =20 /* * pseries-2.3 @@ -5340,7 +5349,7 @@ static void spapr_machine_2_3_class_options(MachineCl= ass *mc) compat_props_add(mc->compat_props, hw_compat_2_3, hw_compat_2_3_len); compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); } -DEFINE_SPAPR_MACHINE(2_3, "2.3", false); +DEFINE_SPAPR_MACHINE(2, 3); =20 /* * pseries-2.2 @@ -5357,7 +5366,7 @@ static void spapr_machine_2_2_class_options(MachineCl= ass *mc) compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); mc->default_machine_opts =3D "modern-hotplug-events=3Doff,suppress-vmd= esc=3Don"; } -DEFINE_SPAPR_MACHINE(2_2, "2.2", false); +DEFINE_SPAPR_MACHINE(2, 2); =20 /* * pseries-2.1 @@ -5368,7 +5377,7 @@ static void spapr_machine_2_1_class_options(MachineCl= ass *mc) spapr_machine_2_2_class_options(mc); compat_props_add(mc->compat_props, hw_compat_2_1, hw_compat_2_1_len); } -DEFINE_SPAPR_MACHINE(2_1, "2.1", false); +DEFINE_SPAPR_MACHINE(2, 1); =20 static void spapr_machine_register_types(void) { --=20 2.43.0 From nobody Mon Nov 25 01:54:36 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=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 1718902881212769.4269333043126; Thu, 20 Jun 2024 10:01:21 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 1DCD71080; Thu, 20 Jun 2024 13:01:20 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 31B2812E5; Thu, 20 Jun 2024 12:59:13 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id CF793D12; Thu, 20 Jun 2024 12:59:08 -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 B6DD41313 for ; Thu, 20 Jun 2024 12:58:42 -0400 (EDT) Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-517--EY-h88KO6iH_uXLpO2WVQ-1; Thu, 20 Jun 2024 12:58:40 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 130B219560B0; Thu, 20 Jun 2024 16:58:37 +0000 (UTC) Received: from toolbox.redhat.com (unknown [10.42.28.69]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id CD58B19560AF; Thu, 20 Jun 2024 16:58:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: *** X-Spam-Status: No, score=3.0 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718902722; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=edYIAQPsyNTqsiVIVNO+4eC3DTlCCk5x2IKeT2Ev60Q=; b=Iiu3ompuNaQVr3yzZyL6uVv4uinyuCrLlakctir6OYGn9X7HI7VvPibM2AmiNhbI7CE+7W rz2c/xVfWEfUxPUzmvX9oR9tkYJfy1ufi3PYHVA9vt5uAe77E7GsTGG0BbNUslzHAE9u4E JeExVNLWcH0jHHpJXb8BOBDuB3jBycE= X-MC-Unique: -EY-h88KO6iH_uXLpO2WVQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH v2 05/14] hw/m68k: convert 'virt' machine definitions to use new macros Date: Thu, 20 Jun 2024 17:57:33 +0100 Message-ID: <20240620165742.1711389-6-berrange@redhat.com> In-Reply-To: <20240620165742.1711389-1-berrange@redhat.com> References: <20240620165742.1711389-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: QEDDHAC2GXJJSEVI4WEYMIQWCY2HJKL3 X-Message-ID-Hash: QEDDHAC2GXJJSEVI4WEYMIQWCY2HJKL3 X-MailFrom: berrange@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 CC: Halil Pasic , devel@lists.libvirt.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , qemu-s390x@nongnu.org, Richard Henderson , Nicholas Piggin , David Hildenbrand , Ilya Leoshkevich , David Gibson , qemu-arm@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora , Yanan Wang , Eduardo Habkost , Peter Maydell , Daniel Henrique Barboza , Thomas Huth , Paolo Bonzini , Marcel Apfelbaum , Christian Borntraeger , Laurent Vivier , qemu-ppc@nongnu.org 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: 1718902881973100001 Content-Type: text/plain; charset="utf-8" This changes the DEFINE_VIRT_MACHINE macro to use the common helpers for constructing versioned symbol names and strings, bringing greater consistency across targets. A DEFINE_VIRT_MACHINE_AS_LATEST helper is added so that it is not required to pass 'false' for every single historical machine type. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/m68k/virt.c | 51 ++++++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 22 deletions(-) diff --git a/hw/m68k/virt.c b/hw/m68k/virt.c index 09bc9bdfef..cd6ee692f7 100644 --- a/hw/m68k/virt.c +++ b/hw/m68k/virt.c @@ -335,99 +335,106 @@ static void virt_machine_register_types(void) =20 type_init(virt_machine_register_types) =20 -#define DEFINE_VIRT_MACHINE(major, minor, latest) \ - static void virt_##major##_##minor##_class_init(ObjectClass *oc, \ - void *data) \ +#define DEFINE_VIRT_MACHINE_IMPL(latest, ...) \ + static void MACHINE_VER_SYM(class_init, virt, __VA_ARGS__)( \ + ObjectClass *oc, \ + void *data) \ { \ MachineClass *mc =3D MACHINE_CLASS(oc); \ - virt_machine_##major##_##minor##_options(mc); \ - mc->desc =3D "QEMU " # major "." # minor " M68K Virtual Machine"; \ + MACHINE_VER_SYM(options, virt, __VA_ARGS__)(mc); \ + mc->desc =3D "QEMU " MACHINE_VER_STR(__VA_ARGS__) " M68K Virtual M= achine"; \ if (latest) { \ mc->alias =3D "virt"; \ } \ } \ - static const TypeInfo machvirt_##major##_##minor##_info =3D { \ - .name =3D MACHINE_TYPE_NAME("virt-" # major "." # minor), \ + static const TypeInfo MACHINE_VER_SYM(info, virt, __VA_ARGS__) =3D \ + { \ + .name =3D MACHINE_VER_TYPE_NAME("virt", __VA_ARGS__), \ .parent =3D MACHINE_TYPE_NAME("virt"), \ - .class_init =3D virt_##major##_##minor##_class_init, \ + .class_init =3D MACHINE_VER_SYM(class_init, virt, __VA_ARGS__), \ }; \ - static void machvirt_machine_##major##_##minor##_init(void) \ + static void MACHINE_VER_SYM(register, virt, __VA_ARGS__)(void) \ { \ - type_register_static(&machvirt_##major##_##minor##_info); \ + type_register_static(&MACHINE_VER_SYM(info, virt, __VA_ARGS__)); \ } \ - type_init(machvirt_machine_##major##_##minor##_init); + type_init(MACHINE_VER_SYM(register, virt, __VA_ARGS__)); + +#define DEFINE_VIRT_MACHINE_AS_LATEST(major, minor) \ + DEFINE_VIRT_MACHINE_IMPL(true, major, minor) +#define DEFINE_VIRT_MACHINE(major, minor) \ + DEFINE_VIRT_MACHINE_IMPL(false, major, minor) =20 static void virt_machine_9_1_options(MachineClass *mc) { } -DEFINE_VIRT_MACHINE(9, 1, true) +DEFINE_VIRT_MACHINE_AS_LATEST(9, 1) =20 static void virt_machine_9_0_options(MachineClass *mc) { virt_machine_9_1_options(mc); compat_props_add(mc->compat_props, hw_compat_9_0, hw_compat_9_0_len); } -DEFINE_VIRT_MACHINE(9, 0, false) +DEFINE_VIRT_MACHINE(9, 0) =20 static void virt_machine_8_2_options(MachineClass *mc) { virt_machine_9_0_options(mc); compat_props_add(mc->compat_props, hw_compat_8_2, hw_compat_8_2_len); } -DEFINE_VIRT_MACHINE(8, 2, false) +DEFINE_VIRT_MACHINE(8, 2) =20 static void virt_machine_8_1_options(MachineClass *mc) { virt_machine_8_2_options(mc); compat_props_add(mc->compat_props, hw_compat_8_1, hw_compat_8_1_len); } -DEFINE_VIRT_MACHINE(8, 1, false) +DEFINE_VIRT_MACHINE(8, 1) =20 static void virt_machine_8_0_options(MachineClass *mc) { virt_machine_8_1_options(mc); compat_props_add(mc->compat_props, hw_compat_8_0, hw_compat_8_0_len); } -DEFINE_VIRT_MACHINE(8, 0, false) +DEFINE_VIRT_MACHINE(8, 0) =20 static void virt_machine_7_2_options(MachineClass *mc) { virt_machine_8_0_options(mc); compat_props_add(mc->compat_props, hw_compat_7_2, hw_compat_7_2_len); } -DEFINE_VIRT_MACHINE(7, 2, false) +DEFINE_VIRT_MACHINE(7, 2) =20 static void virt_machine_7_1_options(MachineClass *mc) { virt_machine_7_2_options(mc); compat_props_add(mc->compat_props, hw_compat_7_1, hw_compat_7_1_len); } -DEFINE_VIRT_MACHINE(7, 1, false) +DEFINE_VIRT_MACHINE(7, 1) =20 static void virt_machine_7_0_options(MachineClass *mc) { virt_machine_7_1_options(mc); compat_props_add(mc->compat_props, hw_compat_7_0, hw_compat_7_0_len); } -DEFINE_VIRT_MACHINE(7, 0, false) +DEFINE_VIRT_MACHINE(7, 0) =20 static void virt_machine_6_2_options(MachineClass *mc) { virt_machine_7_0_options(mc); compat_props_add(mc->compat_props, hw_compat_6_2, hw_compat_6_2_len); } -DEFINE_VIRT_MACHINE(6, 2, false) +DEFINE_VIRT_MACHINE(6, 2) =20 static void virt_machine_6_1_options(MachineClass *mc) { virt_machine_6_2_options(mc); compat_props_add(mc->compat_props, hw_compat_6_1, hw_compat_6_1_len); } -DEFINE_VIRT_MACHINE(6, 1, false) +DEFINE_VIRT_MACHINE(6, 1) =20 static void virt_machine_6_0_options(MachineClass *mc) { virt_machine_6_1_options(mc); compat_props_add(mc->compat_props, hw_compat_6_0, hw_compat_6_0_len); } -DEFINE_VIRT_MACHINE(6, 0, false) +DEFINE_VIRT_MACHINE(6, 0) --=20 2.43.0 From nobody Mon Nov 25 01:54:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1718902777; cv=none; d=zohomail.com; s=zohoarc; b=BfnYislTVWZ3xl9ruKFEDFaziaHhmw5gjLcknQW5oDCNQNyFrsAGIySqwGzlCYbx7gYuT9iNR76F5Htq+SpOrtAQw1zv5BBqHKoOFXoKv0GdEHHduJNQ/IoMRa1w5jWAN1prun+uPvASrYXvZhs8AfWujaq85Uhsfemt460B59k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718902777; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RdajJxPxsGIaHqW/QhgcGhN3ZoJdHh/ppbDzKcn5hKU=; b=egLnxH1iVYSK46o8tbVZmV07gIKNvy4O2WZlgWI5kZEj/oT+vMU9hww/mpNhsswdrhmJRn8CVd7phyl+wt3KB0U3SSFEtSV5NCxOpzZR7qRHEQjGXc3A0kwW0KOOftEp2gz4a/c/0MipZ754EzUWjK1ZwuPOgPrbQDLHXXPt9JI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1718902777192306.256619112326; Thu, 20 Jun 2024 09:59:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKL7h-0006I1-AN; Thu, 20 Jun 2024 12:58:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL7f-0006H0-Rc for qemu-devel@nongnu.org; Thu, 20 Jun 2024 12:58:55 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL7d-000114-Eg for qemu-devel@nongnu.org; Thu, 20 Jun 2024 12:58:55 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-325-ujMvmrkwOBGPcn6XEXc6FA-1; Thu, 20 Jun 2024 12:58:49 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5EAA41956094; Thu, 20 Jun 2024 16:58:46 +0000 (UTC) Received: from toolbox.redhat.com (unknown [10.42.28.69]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 9595F19560AF; Thu, 20 Jun 2024 16:58:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718902732; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RdajJxPxsGIaHqW/QhgcGhN3ZoJdHh/ppbDzKcn5hKU=; b=V5KFUxw89q61hThf3NvbhSm3vb3mEPnocVYDWa57LvEvdZkla7+9yBk5IkCV/EPkx9rlLW gPX3M+thxCJNRpNh/0zr8dMEa4PNMENRTDN5orC4DyTNl9+GMhNi+PyN9OFwAPlMdoty3k RmsYypB7J0E0BhE1EzfhGJAWnYDMCWU= X-MC-Unique: ujMvmrkwOBGPcn6XEXc6FA-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Halil Pasic , devel@lists.libvirt.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Eric Farman , qemu-s390x@nongnu.org, Richard Henderson , Nicholas Piggin , David Hildenbrand , Ilya Leoshkevich , David Gibson , qemu-arm@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora , Yanan Wang , Eduardo Habkost , Peter Maydell , Daniel Henrique Barboza , Thomas Huth , Paolo Bonzini , Marcel Apfelbaum , Christian Borntraeger , Laurent Vivier , qemu-ppc@nongnu.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 06/14] hw/i386: convert 'i440fx' machine definitions to use new macros Date: Thu, 20 Jun 2024 17:57:34 +0100 Message-ID: <20240620165742.1711389-7-berrange@redhat.com> In-Reply-To: <20240620165742.1711389-1-berrange@redhat.com> References: <20240620165742.1711389-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.152, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1718902779173100003 This changes the DEFINE_I440FX_MACHINE macro to use the common helpers for constructing versioned symbol names and strings, bringing greater consistency across targets. The added benefit is that it avoids the need to repeat the version number thrice in three different formats in the calls to DEFINE_I440FX_MACHINE. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- hw/i386/pc_piix.c | 219 +++++++++++++++++++------------------------ include/hw/i386/pc.h | 26 +++++ 2 files changed, 122 insertions(+), 123 deletions(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index e4930b7f48..5705d6e155 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -445,12 +445,13 @@ static void pc_xen_hvm_init(MachineState *machine) } #endif =20 -#define DEFINE_I440FX_MACHINE(suffix, name, optionfn) \ - static void pc_init_##suffix(MachineState *machine) \ - { \ - pc_init1(machine, TYPE_I440FX_PCI_DEVICE); \ - } \ - DEFINE_PC_MACHINE(suffix, name, pc_init_##suffix, optionfn) +static void pc_i440fx_init(MachineState *machine) +{ + pc_init1(machine, TYPE_I440FX_PCI_DEVICE); +} + +#define DEFINE_I440FX_MACHINE(major, minor) \ + DEFINE_PC_VER_MACHINE(pc_i440fx, "pc-i440fx", pc_i440fx_init, major, m= inor); =20 static void pc_i440fx_machine_options(MachineClass *m) { @@ -478,21 +479,20 @@ static void pc_i440fx_machine_options(MachineClass *m) "Use a different south bridge than PI= IX3"); } =20 -static void pc_i440fx_9_1_machine_options(MachineClass *m) +static void pc_i440fx_machine_9_1_options(MachineClass *m) { pc_i440fx_machine_options(m); m->alias =3D "pc"; m->is_default =3D true; } =20 -DEFINE_I440FX_MACHINE(v9_1, "pc-i440fx-9.1", - pc_i440fx_9_1_machine_options); +DEFINE_I440FX_MACHINE(9, 1); =20 -static void pc_i440fx_9_0_machine_options(MachineClass *m) +static void pc_i440fx_machine_9_0_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); =20 - pc_i440fx_9_1_machine_options(m); + pc_i440fx_machine_9_1_options(m); m->alias =3D NULL; m->is_default =3D false; =20 @@ -501,14 +501,13 @@ static void pc_i440fx_9_0_machine_options(MachineClas= s *m) pcmc->isa_bios_alias =3D false; } =20 -DEFINE_I440FX_MACHINE(v9_0, "pc-i440fx-9.0", - pc_i440fx_9_0_machine_options); +DEFINE_I440FX_MACHINE(9, 0); =20 -static void pc_i440fx_8_2_machine_options(MachineClass *m) +static void pc_i440fx_machine_8_2_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); =20 - pc_i440fx_9_0_machine_options(m); + pc_i440fx_machine_9_0_options(m); =20 compat_props_add(m->compat_props, hw_compat_8_2, hw_compat_8_2_len); compat_props_add(m->compat_props, pc_compat_8_2, pc_compat_8_2_len); @@ -516,28 +515,26 @@ static void pc_i440fx_8_2_machine_options(MachineClas= s *m) pcmc->default_smbios_ep_type =3D SMBIOS_ENTRY_POINT_TYPE_64; } =20 -DEFINE_I440FX_MACHINE(v8_2, "pc-i440fx-8.2", - pc_i440fx_8_2_machine_options); +DEFINE_I440FX_MACHINE(8, 2); =20 -static void pc_i440fx_8_1_machine_options(MachineClass *m) +static void pc_i440fx_machine_8_1_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); =20 - pc_i440fx_8_2_machine_options(m); + pc_i440fx_machine_8_2_options(m); pcmc->broken_32bit_mem_addr_check =3D true; =20 compat_props_add(m->compat_props, hw_compat_8_1, hw_compat_8_1_len); compat_props_add(m->compat_props, pc_compat_8_1, pc_compat_8_1_len); } =20 -DEFINE_I440FX_MACHINE(v8_1, "pc-i440fx-8.1", - pc_i440fx_8_1_machine_options); +DEFINE_I440FX_MACHINE(8, 1); =20 -static void pc_i440fx_8_0_machine_options(MachineClass *m) +static void pc_i440fx_machine_8_0_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); =20 - pc_i440fx_8_1_machine_options(m); + pc_i440fx_machine_8_1_options(m); compat_props_add(m->compat_props, hw_compat_8_0, hw_compat_8_0_len); compat_props_add(m->compat_props, pc_compat_8_0, pc_compat_8_0_len); =20 @@ -545,268 +542,244 @@ static void pc_i440fx_8_0_machine_options(MachineCl= ass *m) pcmc->default_smbios_ep_type =3D SMBIOS_ENTRY_POINT_TYPE_32; } =20 -DEFINE_I440FX_MACHINE(v8_0, "pc-i440fx-8.0", - pc_i440fx_8_0_machine_options); +DEFINE_I440FX_MACHINE(8, 0); =20 -static void pc_i440fx_7_2_machine_options(MachineClass *m) +static void pc_i440fx_machine_7_2_options(MachineClass *m) { - pc_i440fx_8_0_machine_options(m); + pc_i440fx_machine_8_0_options(m); compat_props_add(m->compat_props, hw_compat_7_2, hw_compat_7_2_len); compat_props_add(m->compat_props, pc_compat_7_2, pc_compat_7_2_len); } =20 -DEFINE_I440FX_MACHINE(v7_2, "pc-i440fx-7.2", - pc_i440fx_7_2_machine_options); +DEFINE_I440FX_MACHINE(7, 2) =20 -static void pc_i440fx_7_1_machine_options(MachineClass *m) +static void pc_i440fx_machine_7_1_options(MachineClass *m) { - pc_i440fx_7_2_machine_options(m); + pc_i440fx_machine_7_2_options(m); compat_props_add(m->compat_props, hw_compat_7_1, hw_compat_7_1_len); compat_props_add(m->compat_props, pc_compat_7_1, pc_compat_7_1_len); } =20 -DEFINE_I440FX_MACHINE(v7_1, "pc-i440fx-7.1", - pc_i440fx_7_1_machine_options); +DEFINE_I440FX_MACHINE(7, 1); =20 -static void pc_i440fx_7_0_machine_options(MachineClass *m) +static void pc_i440fx_machine_7_0_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); - pc_i440fx_7_1_machine_options(m); + pc_i440fx_machine_7_1_options(m); pcmc->enforce_amd_1tb_hole =3D false; compat_props_add(m->compat_props, hw_compat_7_0, hw_compat_7_0_len); compat_props_add(m->compat_props, pc_compat_7_0, pc_compat_7_0_len); } =20 -DEFINE_I440FX_MACHINE(v7_0, "pc-i440fx-7.0", - pc_i440fx_7_0_machine_options); +DEFINE_I440FX_MACHINE(7, 0); =20 -static void pc_i440fx_6_2_machine_options(MachineClass *m) +static void pc_i440fx_machine_6_2_options(MachineClass *m) { - pc_i440fx_7_0_machine_options(m); + pc_i440fx_machine_7_0_options(m); compat_props_add(m->compat_props, hw_compat_6_2, hw_compat_6_2_len); compat_props_add(m->compat_props, pc_compat_6_2, pc_compat_6_2_len); } =20 -DEFINE_I440FX_MACHINE(v6_2, "pc-i440fx-6.2", - pc_i440fx_6_2_machine_options); +DEFINE_I440FX_MACHINE(6, 2); =20 -static void pc_i440fx_6_1_machine_options(MachineClass *m) +static void pc_i440fx_machine_6_1_options(MachineClass *m) { - pc_i440fx_6_2_machine_options(m); + pc_i440fx_machine_6_2_options(m); compat_props_add(m->compat_props, hw_compat_6_1, hw_compat_6_1_len); compat_props_add(m->compat_props, pc_compat_6_1, pc_compat_6_1_len); m->smp_props.prefer_sockets =3D true; } =20 -DEFINE_I440FX_MACHINE(v6_1, "pc-i440fx-6.1", - pc_i440fx_6_1_machine_options); +DEFINE_I440FX_MACHINE(6, 1); =20 -static void pc_i440fx_6_0_machine_options(MachineClass *m) +static void pc_i440fx_machine_6_0_options(MachineClass *m) { - pc_i440fx_6_1_machine_options(m); + pc_i440fx_machine_6_1_options(m); compat_props_add(m->compat_props, hw_compat_6_0, hw_compat_6_0_len); compat_props_add(m->compat_props, pc_compat_6_0, pc_compat_6_0_len); } =20 -DEFINE_I440FX_MACHINE(v6_0, "pc-i440fx-6.0", - pc_i440fx_6_0_machine_options); +DEFINE_I440FX_MACHINE(6, 0); =20 -static void pc_i440fx_5_2_machine_options(MachineClass *m) +static void pc_i440fx_machine_5_2_options(MachineClass *m) { - pc_i440fx_6_0_machine_options(m); + pc_i440fx_machine_6_0_options(m); compat_props_add(m->compat_props, hw_compat_5_2, hw_compat_5_2_len); compat_props_add(m->compat_props, pc_compat_5_2, pc_compat_5_2_len); } =20 -DEFINE_I440FX_MACHINE(v5_2, "pc-i440fx-5.2", - pc_i440fx_5_2_machine_options); +DEFINE_I440FX_MACHINE(5, 2); =20 -static void pc_i440fx_5_1_machine_options(MachineClass *m) +static void pc_i440fx_machine_5_1_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); =20 - pc_i440fx_5_2_machine_options(m); + pc_i440fx_machine_5_2_options(m); compat_props_add(m->compat_props, hw_compat_5_1, hw_compat_5_1_len); compat_props_add(m->compat_props, pc_compat_5_1, pc_compat_5_1_len); pcmc->kvmclock_create_always =3D false; pcmc->pci_root_uid =3D 1; } =20 -DEFINE_I440FX_MACHINE(v5_1, "pc-i440fx-5.1", - pc_i440fx_5_1_machine_options); +DEFINE_I440FX_MACHINE(5, 1); =20 -static void pc_i440fx_5_0_machine_options(MachineClass *m) +static void pc_i440fx_machine_5_0_options(MachineClass *m) { - pc_i440fx_5_1_machine_options(m); + pc_i440fx_machine_5_1_options(m); m->numa_mem_supported =3D true; compat_props_add(m->compat_props, hw_compat_5_0, hw_compat_5_0_len); compat_props_add(m->compat_props, pc_compat_5_0, pc_compat_5_0_len); m->auto_enable_numa_with_memdev =3D false; } =20 -DEFINE_I440FX_MACHINE(v5_0, "pc-i440fx-5.0", - pc_i440fx_5_0_machine_options); +DEFINE_I440FX_MACHINE(5, 0); =20 -static void pc_i440fx_4_2_machine_options(MachineClass *m) +static void pc_i440fx_machine_4_2_options(MachineClass *m) { - pc_i440fx_5_0_machine_options(m); + pc_i440fx_machine_5_0_options(m); compat_props_add(m->compat_props, hw_compat_4_2, hw_compat_4_2_len); compat_props_add(m->compat_props, pc_compat_4_2, pc_compat_4_2_len); } =20 -DEFINE_I440FX_MACHINE(v4_2, "pc-i440fx-4.2", - pc_i440fx_4_2_machine_options); +DEFINE_I440FX_MACHINE(4, 2); =20 -static void pc_i440fx_4_1_machine_options(MachineClass *m) +static void pc_i440fx_machine_4_1_options(MachineClass *m) { - pc_i440fx_4_2_machine_options(m); + pc_i440fx_machine_4_2_options(m); compat_props_add(m->compat_props, hw_compat_4_1, hw_compat_4_1_len); compat_props_add(m->compat_props, pc_compat_4_1, pc_compat_4_1_len); } =20 -DEFINE_I440FX_MACHINE(v4_1, "pc-i440fx-4.1", - pc_i440fx_4_1_machine_options); +DEFINE_I440FX_MACHINE(4, 1); =20 -static void pc_i440fx_4_0_machine_options(MachineClass *m) +static void pc_i440fx_machine_4_0_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); - pc_i440fx_4_1_machine_options(m); + pc_i440fx_machine_4_1_options(m); pcmc->default_cpu_version =3D CPU_VERSION_LEGACY; compat_props_add(m->compat_props, hw_compat_4_0, hw_compat_4_0_len); compat_props_add(m->compat_props, pc_compat_4_0, pc_compat_4_0_len); } =20 -DEFINE_I440FX_MACHINE(v4_0, "pc-i440fx-4.0", - pc_i440fx_4_0_machine_options); +DEFINE_I440FX_MACHINE(4, 0); =20 -static void pc_i440fx_3_1_machine_options(MachineClass *m) +static void pc_i440fx_machine_3_1_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); =20 - pc_i440fx_4_0_machine_options(m); + pc_i440fx_machine_4_0_options(m); m->smbus_no_migration_support =3D true; pcmc->pvh_enabled =3D false; compat_props_add(m->compat_props, hw_compat_3_1, hw_compat_3_1_len); compat_props_add(m->compat_props, pc_compat_3_1, pc_compat_3_1_len); } =20 -DEFINE_I440FX_MACHINE(v3_1, "pc-i440fx-3.1", - pc_i440fx_3_1_machine_options); +DEFINE_I440FX_MACHINE(3, 1); =20 -static void pc_i440fx_3_0_machine_options(MachineClass *m) +static void pc_i440fx_machine_3_0_options(MachineClass *m) { - pc_i440fx_3_1_machine_options(m); + pc_i440fx_machine_3_1_options(m); compat_props_add(m->compat_props, hw_compat_3_0, hw_compat_3_0_len); compat_props_add(m->compat_props, pc_compat_3_0, pc_compat_3_0_len); } =20 -DEFINE_I440FX_MACHINE(v3_0, "pc-i440fx-3.0", - pc_i440fx_3_0_machine_options); +DEFINE_I440FX_MACHINE(3, 0); =20 -static void pc_i440fx_2_12_machine_options(MachineClass *m) +static void pc_i440fx_machine_2_12_options(MachineClass *m) { - pc_i440fx_3_0_machine_options(m); + pc_i440fx_machine_3_0_options(m); m->deprecation_reason =3D "old and unattended - use a newer version in= stead"; compat_props_add(m->compat_props, hw_compat_2_12, hw_compat_2_12_len); compat_props_add(m->compat_props, pc_compat_2_12, pc_compat_2_12_len); } =20 -DEFINE_I440FX_MACHINE(v2_12, "pc-i440fx-2.12", - pc_i440fx_2_12_machine_options); +DEFINE_I440FX_MACHINE(2, 12); =20 -static void pc_i440fx_2_11_machine_options(MachineClass *m) +static void pc_i440fx_machine_2_11_options(MachineClass *m) { - pc_i440fx_2_12_machine_options(m); + pc_i440fx_machine_2_12_options(m); compat_props_add(m->compat_props, hw_compat_2_11, hw_compat_2_11_len); compat_props_add(m->compat_props, pc_compat_2_11, pc_compat_2_11_len); } =20 -DEFINE_I440FX_MACHINE(v2_11, "pc-i440fx-2.11", - pc_i440fx_2_11_machine_options); +DEFINE_I440FX_MACHINE(2, 11); =20 -static void pc_i440fx_2_10_machine_options(MachineClass *m) +static void pc_i440fx_machine_2_10_options(MachineClass *m) { - pc_i440fx_2_11_machine_options(m); + pc_i440fx_machine_2_11_options(m); compat_props_add(m->compat_props, hw_compat_2_10, hw_compat_2_10_len); compat_props_add(m->compat_props, pc_compat_2_10, pc_compat_2_10_len); m->auto_enable_numa_with_memhp =3D false; } =20 -DEFINE_I440FX_MACHINE(v2_10, "pc-i440fx-2.10", - pc_i440fx_2_10_machine_options); +DEFINE_I440FX_MACHINE(2, 10); =20 -static void pc_i440fx_2_9_machine_options(MachineClass *m) +static void pc_i440fx_machine_2_9_options(MachineClass *m) { - pc_i440fx_2_10_machine_options(m); + pc_i440fx_machine_2_10_options(m); compat_props_add(m->compat_props, hw_compat_2_9, hw_compat_2_9_len); compat_props_add(m->compat_props, pc_compat_2_9, pc_compat_2_9_len); } =20 -DEFINE_I440FX_MACHINE(v2_9, "pc-i440fx-2.9", - pc_i440fx_2_9_machine_options); +DEFINE_I440FX_MACHINE(2, 9); =20 -static void pc_i440fx_2_8_machine_options(MachineClass *m) +static void pc_i440fx_machine_2_8_options(MachineClass *m) { - pc_i440fx_2_9_machine_options(m); + pc_i440fx_machine_2_9_options(m); compat_props_add(m->compat_props, hw_compat_2_8, hw_compat_2_8_len); compat_props_add(m->compat_props, pc_compat_2_8, pc_compat_2_8_len); } =20 -DEFINE_I440FX_MACHINE(v2_8, "pc-i440fx-2.8", - pc_i440fx_2_8_machine_options); +DEFINE_I440FX_MACHINE(2, 8); =20 -static void pc_i440fx_2_7_machine_options(MachineClass *m) +static void pc_i440fx_machine_2_7_options(MachineClass *m) { - pc_i440fx_2_8_machine_options(m); + pc_i440fx_machine_2_8_options(m); compat_props_add(m->compat_props, hw_compat_2_7, hw_compat_2_7_len); compat_props_add(m->compat_props, pc_compat_2_7, pc_compat_2_7_len); } =20 -DEFINE_I440FX_MACHINE(v2_7, "pc-i440fx-2.7", - pc_i440fx_2_7_machine_options); +DEFINE_I440FX_MACHINE(2, 7); =20 -static void pc_i440fx_2_6_machine_options(MachineClass *m) +static void pc_i440fx_machine_2_6_options(MachineClass *m) { X86MachineClass *x86mc =3D X86_MACHINE_CLASS(m); PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); =20 - pc_i440fx_2_7_machine_options(m); + pc_i440fx_machine_2_7_options(m); pcmc->legacy_cpu_hotplug =3D true; x86mc->fwcfg_dma_enabled =3D false; compat_props_add(m->compat_props, hw_compat_2_6, hw_compat_2_6_len); compat_props_add(m->compat_props, pc_compat_2_6, pc_compat_2_6_len); } =20 -DEFINE_I440FX_MACHINE(v2_6, "pc-i440fx-2.6", - pc_i440fx_2_6_machine_options); +DEFINE_I440FX_MACHINE(2, 6); =20 -static void pc_i440fx_2_5_machine_options(MachineClass *m) +static void pc_i440fx_machine_2_5_options(MachineClass *m) { X86MachineClass *x86mc =3D X86_MACHINE_CLASS(m); =20 - pc_i440fx_2_6_machine_options(m); + pc_i440fx_machine_2_6_options(m); x86mc->save_tsc_khz =3D false; m->legacy_fw_cfg_order =3D 1; compat_props_add(m->compat_props, hw_compat_2_5, hw_compat_2_5_len); compat_props_add(m->compat_props, pc_compat_2_5, pc_compat_2_5_len); } =20 -DEFINE_I440FX_MACHINE(v2_5, "pc-i440fx-2.5", - pc_i440fx_2_5_machine_options); +DEFINE_I440FX_MACHINE(2, 5); =20 -static void pc_i440fx_2_4_machine_options(MachineClass *m) +static void pc_i440fx_machine_2_4_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); =20 - pc_i440fx_2_5_machine_options(m); + pc_i440fx_machine_2_5_options(m); m->hw_version =3D "2.4.0"; pcmc->broken_reserved_end =3D true; compat_props_add(m->compat_props, hw_compat_2_4, hw_compat_2_4_len); compat_props_add(m->compat_props, pc_compat_2_4, pc_compat_2_4_len); } =20 -DEFINE_I440FX_MACHINE(v2_4, "pc-i440fx-2.4", - pc_i440fx_2_4_machine_options) +DEFINE_I440FX_MACHINE(2, 4); =20 #ifdef CONFIG_ISAPC static void isapc_machine_options(MachineClass *m) @@ -833,20 +806,20 @@ DEFINE_PC_MACHINE(isapc, "isapc", pc_init_isa, #endif =20 #ifdef CONFIG_XEN -static void xenfv_4_2_machine_options(MachineClass *m) +static void xenfv_machine_4_2_options(MachineClass *m) { - pc_i440fx_4_2_machine_options(m); + pc_i440fx_machine_4_2_options(m); m->desc =3D "Xen Fully-virtualized PC"; m->max_cpus =3D HVM_MAX_VCPUS; m->default_machine_opts =3D "accel=3Dxen,suppress-vmdesc=3Don"; } =20 DEFINE_PC_MACHINE(xenfv_4_2, "xenfv-4.2", pc_xen_hvm_init, - xenfv_4_2_machine_options); + xenfv_machine_4_2_options); =20 -static void xenfv_3_1_machine_options(MachineClass *m) +static void xenfv_machine_3_1_options(MachineClass *m) { - pc_i440fx_3_1_machine_options(m); + pc_i440fx_machine_3_1_options(m); m->desc =3D "Xen Fully-virtualized PC"; m->alias =3D "xenfv"; m->max_cpus =3D HVM_MAX_VCPUS; @@ -854,5 +827,5 @@ static void xenfv_3_1_machine_options(MachineClass *m) } =20 DEFINE_PC_MACHINE(xenfv, "xenfv-3.1", pc_xen_hvm_init, - xenfv_3_1_machine_options); + xenfv_machine_3_1_options); #endif diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 46bc411063..027c6f29f7 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -317,4 +317,30 @@ extern const size_t pc_compat_2_3_len; } \ type_init(pc_machine_init_##suffix) =20 +#define DEFINE_PC_VER_MACHINE(namesym, namestr, initfn, ...) \ + static void MACHINE_VER_SYM(init, namesym, __VA_ARGS__)( \ + MachineState *machine) \ + { \ + initfn(machine); \ + } \ + static void MACHINE_VER_SYM(class_init, namesym, __VA_ARGS__)( \ + ObjectClass *oc, \ + void *data) \ + { \ + MachineClass *mc =3D MACHINE_CLASS(oc); \ + MACHINE_VER_SYM(options, namesym, __VA_ARGS__)(mc); \ + mc->init =3D MACHINE_VER_SYM(init, namesym, __VA_ARGS__); \ + } \ + static const TypeInfo MACHINE_VER_SYM(info, namesym, __VA_ARGS__) =3D \ + { \ + .name =3D MACHINE_VER_TYPE_NAME(namestr, __VA_ARGS__), \ + .parent =3D TYPE_PC_MACHINE, \ + .class_init =3D MACHINE_VER_SYM(class_init, namesym, __VA_ARGS__),= \ + }; \ + static void MACHINE_VER_SYM(register, namesym, __VA_ARGS__)(void) \ + { \ + type_register(&MACHINE_VER_SYM(info, namesym, __VA_ARGS__)); \ + } \ + type_init(MACHINE_VER_SYM(register, namesym, __VA_ARGS__)); + #endif --=20 2.43.0 From nobody Mon Nov 25 01:54:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1718902842; cv=none; d=zohomail.com; s=zohoarc; b=c2CPHoE8ya/k8XESP5ejpR4HE7yWk7pr9KUSCoUm5lDPEY7cG4OF/Xx6bQtWfrb9sJSQzqhfVtr8VCY31qpbW3TtDYa9vr6fx4WjENAitAhQkElmGgdhBcyuawm/O1wF6U+veA3ChQVeotQfTLR3Mbwg3KszUt6kxAPdc1fJNo4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718902842; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=yM/ZKKUFXcCJ4ccFNgb/9Aqxl2B27OATNFN9s8rFvd8=; b=dZCl91wzXStm7MuYfabnjNpJApscdhyF5EkdSbw6AB1y6Tg2AKxdDkov1wL3gMqQGLi+/jbgzJ9Y7Gakr6hERxjuHJSP+KZUqvTzTtKSZjF9oVmQpOW7j2eYWXl9EsRLllk8wZnIsCmBDTvpkk1TK4y/B1eLgZQkc+sGTCV8hFg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1718902842551205.91647804331876; Thu, 20 Jun 2024 10:00:42 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKL7x-0006n3-5d; Thu, 20 Jun 2024 12:59:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL7v-0006iB-TU for qemu-devel@nongnu.org; Thu, 20 Jun 2024 12:59:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL7q-00012s-Kd for qemu-devel@nongnu.org; Thu, 20 Jun 2024 12:59:11 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-152-_uNM2Ta4O2ycPhtFvOL2vw-1; Thu, 20 Jun 2024 12:59:00 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BF671195609E; Thu, 20 Jun 2024 16:58:55 +0000 (UTC) Received: from toolbox.redhat.com (unknown [10.42.28.69]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E439A19560B4; Thu, 20 Jun 2024 16:58:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718902746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yM/ZKKUFXcCJ4ccFNgb/9Aqxl2B27OATNFN9s8rFvd8=; b=RcGq3dqRufxsiJY9AayChCF0PiFj1llJzC6aLKiKhgv/hESh5BnWZf0G8r1Rp6yVfIT0BC SMiEYbYnF5Eet1LaTCKlTIufg4aPVrsDrRn6GU2hhNRIGe3ass2mn4tIQi0Qmf0Eh7yM41 lC05TCF3jQPh2/Dlc3hOXVGAHmQZnfs= X-MC-Unique: _uNM2Ta4O2ycPhtFvOL2vw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Halil Pasic , devel@lists.libvirt.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Eric Farman , qemu-s390x@nongnu.org, Richard Henderson , Nicholas Piggin , David Hildenbrand , Ilya Leoshkevich , David Gibson , qemu-arm@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora , Yanan Wang , Eduardo Habkost , Peter Maydell , Daniel Henrique Barboza , Thomas Huth , Paolo Bonzini , Marcel Apfelbaum , Christian Borntraeger , Laurent Vivier , qemu-ppc@nongnu.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 07/14] hw/i386: convert 'q35' machine definitions to use new macros Date: Thu, 20 Jun 2024 17:57:35 +0100 Message-ID: <20240620165742.1711389-8-berrange@redhat.com> In-Reply-To: <20240620165742.1711389-1-berrange@redhat.com> References: <20240620165742.1711389-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.152, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1718902843758100001 This changes the DEFINE_Q35_MACHINE macro to use the common helpers for constructing versioned symbol names and strings, bringing greater consistency across targets. The added benefit is that it avoids the need to repeat the version number thrice in three different formats in the calls to DEFINE_Q35_MACHINE. Due to the odd-ball '4.0.1' machine type version, this commit introduces a DEFINE_Q35_BUGFIX helper, to allow defining of "bugfix" machine types which have a three digit version. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Thomas Huth --- hw/i386/pc_q35.c | 215 ++++++++++++++++++++--------------------------- 1 file changed, 90 insertions(+), 125 deletions(-) diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index bd7db4abac..71d3c6d122 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -331,17 +331,11 @@ static void pc_q35_init(MachineState *machine) } } =20 -#define DEFINE_Q35_MACHINE(suffix, name, compatfn, optionfn) \ - static void pc_init_##suffix(MachineState *machine) \ - { \ - void (*compat)(MachineState *m) =3D (compatfn); \ - if (compat) { \ - compat(machine); \ - } \ - pc_q35_init(machine); \ - } \ - DEFINE_PC_MACHINE(suffix, name, pc_init_##suffix, optionfn) +#define DEFINE_Q35_MACHINE(major, minor) \ + DEFINE_PC_VER_MACHINE(pc_q35, "pc-q35", pc_q35_init, major, minor); =20 +#define DEFINE_Q35_MACHINE_BUGFIX(major, minor, micro) \ + DEFINE_PC_VER_MACHINE(pc_q35, "pc-q35", pc_q35_init, major, minor, mic= ro); =20 static void pc_q35_machine_options(MachineClass *m) { @@ -367,32 +361,30 @@ static void pc_q35_machine_options(MachineClass *m) pc_q35_compat_defaults, pc_q35_compat_defaults_len); } =20 -static void pc_q35_9_1_machine_options(MachineClass *m) +static void pc_q35_machine_9_1_options(MachineClass *m) { pc_q35_machine_options(m); m->alias =3D "q35"; } =20 -DEFINE_Q35_MACHINE(v9_1, "pc-q35-9.1", NULL, - pc_q35_9_1_machine_options); +DEFINE_Q35_MACHINE(9, 1); =20 -static void pc_q35_9_0_machine_options(MachineClass *m) +static void pc_q35_machine_9_0_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); - pc_q35_9_1_machine_options(m); + pc_q35_machine_9_1_options(m); m->alias =3D NULL; compat_props_add(m->compat_props, hw_compat_9_0, hw_compat_9_0_len); compat_props_add(m->compat_props, pc_compat_9_0, pc_compat_9_0_len); pcmc->isa_bios_alias =3D false; } =20 -DEFINE_Q35_MACHINE(v9_0, "pc-q35-9.0", NULL, - pc_q35_9_0_machine_options); +DEFINE_Q35_MACHINE(9, 0); =20 -static void pc_q35_8_2_machine_options(MachineClass *m) +static void pc_q35_machine_8_2_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); - pc_q35_9_0_machine_options(m); + pc_q35_machine_9_0_options(m); m->max_cpus =3D 1024; compat_props_add(m->compat_props, hw_compat_8_2, hw_compat_8_2_len); compat_props_add(m->compat_props, pc_compat_8_2, pc_compat_8_2_len); @@ -400,26 +392,24 @@ static void pc_q35_8_2_machine_options(MachineClass *= m) pcmc->default_smbios_ep_type =3D SMBIOS_ENTRY_POINT_TYPE_64; } =20 -DEFINE_Q35_MACHINE(v8_2, "pc-q35-8.2", NULL, - pc_q35_8_2_machine_options); +DEFINE_Q35_MACHINE(8, 2); =20 -static void pc_q35_8_1_machine_options(MachineClass *m) +static void pc_q35_machine_8_1_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); - pc_q35_8_2_machine_options(m); + pc_q35_machine_8_2_options(m); pcmc->broken_32bit_mem_addr_check =3D true; compat_props_add(m->compat_props, hw_compat_8_1, hw_compat_8_1_len); compat_props_add(m->compat_props, pc_compat_8_1, pc_compat_8_1_len); } =20 -DEFINE_Q35_MACHINE(v8_1, "pc-q35-8.1", NULL, - pc_q35_8_1_machine_options); +DEFINE_Q35_MACHINE(8, 1); =20 -static void pc_q35_8_0_machine_options(MachineClass *m) +static void pc_q35_machine_8_0_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); =20 - pc_q35_8_1_machine_options(m); + pc_q35_machine_8_1_options(m); compat_props_add(m->compat_props, hw_compat_8_0, hw_compat_8_0_len); compat_props_add(m->compat_props, pc_compat_8_0, pc_compat_8_0_len); =20 @@ -428,132 +418,120 @@ static void pc_q35_8_0_machine_options(MachineClass= *m) m->max_cpus =3D 288; } =20 -DEFINE_Q35_MACHINE(v8_0, "pc-q35-8.0", NULL, - pc_q35_8_0_machine_options); +DEFINE_Q35_MACHINE(8, 0); =20 -static void pc_q35_7_2_machine_options(MachineClass *m) +static void pc_q35_machine_7_2_options(MachineClass *m) { - pc_q35_8_0_machine_options(m); + pc_q35_machine_8_0_options(m); compat_props_add(m->compat_props, hw_compat_7_2, hw_compat_7_2_len); compat_props_add(m->compat_props, pc_compat_7_2, pc_compat_7_2_len); } =20 -DEFINE_Q35_MACHINE(v7_2, "pc-q35-7.2", NULL, - pc_q35_7_2_machine_options); +DEFINE_Q35_MACHINE(7, 2); =20 -static void pc_q35_7_1_machine_options(MachineClass *m) +static void pc_q35_machine_7_1_options(MachineClass *m) { - pc_q35_7_2_machine_options(m); + pc_q35_machine_7_2_options(m); compat_props_add(m->compat_props, hw_compat_7_1, hw_compat_7_1_len); compat_props_add(m->compat_props, pc_compat_7_1, pc_compat_7_1_len); } =20 -DEFINE_Q35_MACHINE(v7_1, "pc-q35-7.1", NULL, - pc_q35_7_1_machine_options); +DEFINE_Q35_MACHINE(7, 1); =20 -static void pc_q35_7_0_machine_options(MachineClass *m) +static void pc_q35_machine_7_0_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); - pc_q35_7_1_machine_options(m); + pc_q35_machine_7_1_options(m); pcmc->enforce_amd_1tb_hole =3D false; compat_props_add(m->compat_props, hw_compat_7_0, hw_compat_7_0_len); compat_props_add(m->compat_props, pc_compat_7_0, pc_compat_7_0_len); } =20 -DEFINE_Q35_MACHINE(v7_0, "pc-q35-7.0", NULL, - pc_q35_7_0_machine_options); +DEFINE_Q35_MACHINE(7, 0); =20 -static void pc_q35_6_2_machine_options(MachineClass *m) +static void pc_q35_machine_6_2_options(MachineClass *m) { - pc_q35_7_0_machine_options(m); + pc_q35_machine_7_0_options(m); compat_props_add(m->compat_props, hw_compat_6_2, hw_compat_6_2_len); compat_props_add(m->compat_props, pc_compat_6_2, pc_compat_6_2_len); } =20 -DEFINE_Q35_MACHINE(v6_2, "pc-q35-6.2", NULL, - pc_q35_6_2_machine_options); +DEFINE_Q35_MACHINE(6, 2); =20 -static void pc_q35_6_1_machine_options(MachineClass *m) +static void pc_q35_machine_6_1_options(MachineClass *m) { - pc_q35_6_2_machine_options(m); + pc_q35_machine_6_2_options(m); compat_props_add(m->compat_props, hw_compat_6_1, hw_compat_6_1_len); compat_props_add(m->compat_props, pc_compat_6_1, pc_compat_6_1_len); m->smp_props.prefer_sockets =3D true; } =20 -DEFINE_Q35_MACHINE(v6_1, "pc-q35-6.1", NULL, - pc_q35_6_1_machine_options); +DEFINE_Q35_MACHINE(6, 1); =20 -static void pc_q35_6_0_machine_options(MachineClass *m) +static void pc_q35_machine_6_0_options(MachineClass *m) { - pc_q35_6_1_machine_options(m); + pc_q35_machine_6_1_options(m); compat_props_add(m->compat_props, hw_compat_6_0, hw_compat_6_0_len); compat_props_add(m->compat_props, pc_compat_6_0, pc_compat_6_0_len); } =20 -DEFINE_Q35_MACHINE(v6_0, "pc-q35-6.0", NULL, - pc_q35_6_0_machine_options); +DEFINE_Q35_MACHINE(6, 0); =20 -static void pc_q35_5_2_machine_options(MachineClass *m) +static void pc_q35_machine_5_2_options(MachineClass *m) { - pc_q35_6_0_machine_options(m); + pc_q35_machine_6_0_options(m); compat_props_add(m->compat_props, hw_compat_5_2, hw_compat_5_2_len); compat_props_add(m->compat_props, pc_compat_5_2, pc_compat_5_2_len); } =20 -DEFINE_Q35_MACHINE(v5_2, "pc-q35-5.2", NULL, - pc_q35_5_2_machine_options); +DEFINE_Q35_MACHINE(5, 2); =20 -static void pc_q35_5_1_machine_options(MachineClass *m) +static void pc_q35_machine_5_1_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); =20 - pc_q35_5_2_machine_options(m); + pc_q35_machine_5_2_options(m); compat_props_add(m->compat_props, hw_compat_5_1, hw_compat_5_1_len); compat_props_add(m->compat_props, pc_compat_5_1, pc_compat_5_1_len); pcmc->kvmclock_create_always =3D false; pcmc->pci_root_uid =3D 1; } =20 -DEFINE_Q35_MACHINE(v5_1, "pc-q35-5.1", NULL, - pc_q35_5_1_machine_options); +DEFINE_Q35_MACHINE(5, 1); =20 -static void pc_q35_5_0_machine_options(MachineClass *m) +static void pc_q35_machine_5_0_options(MachineClass *m) { - pc_q35_5_1_machine_options(m); + pc_q35_machine_5_1_options(m); m->numa_mem_supported =3D true; compat_props_add(m->compat_props, hw_compat_5_0, hw_compat_5_0_len); compat_props_add(m->compat_props, pc_compat_5_0, pc_compat_5_0_len); m->auto_enable_numa_with_memdev =3D false; } =20 -DEFINE_Q35_MACHINE(v5_0, "pc-q35-5.0", NULL, - pc_q35_5_0_machine_options); +DEFINE_Q35_MACHINE(5, 0); =20 -static void pc_q35_4_2_machine_options(MachineClass *m) +static void pc_q35_machine_4_2_options(MachineClass *m) { - pc_q35_5_0_machine_options(m); + pc_q35_machine_5_0_options(m); compat_props_add(m->compat_props, hw_compat_4_2, hw_compat_4_2_len); compat_props_add(m->compat_props, pc_compat_4_2, pc_compat_4_2_len); } =20 -DEFINE_Q35_MACHINE(v4_2, "pc-q35-4.2", NULL, - pc_q35_4_2_machine_options); +DEFINE_Q35_MACHINE(4, 2); =20 -static void pc_q35_4_1_machine_options(MachineClass *m) +static void pc_q35_machine_4_1_options(MachineClass *m) { - pc_q35_4_2_machine_options(m); + pc_q35_machine_4_2_options(m); compat_props_add(m->compat_props, hw_compat_4_1, hw_compat_4_1_len); compat_props_add(m->compat_props, pc_compat_4_1, pc_compat_4_1_len); } =20 -DEFINE_Q35_MACHINE(v4_1, "pc-q35-4.1", NULL, - pc_q35_4_1_machine_options); +DEFINE_Q35_MACHINE(4, 1); =20 -static void pc_q35_4_0_1_machine_options(MachineClass *m) +static void pc_q35_machine_4_0_1_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); - pc_q35_4_1_machine_options(m); + pc_q35_machine_4_1_options(m); pcmc->default_cpu_version =3D CPU_VERSION_LEGACY; /* * This is the default machine for the 4.0-stable branch. It is basica= lly @@ -564,24 +542,22 @@ static void pc_q35_4_0_1_machine_options(MachineClass= *m) compat_props_add(m->compat_props, pc_compat_4_0, pc_compat_4_0_len); } =20 -DEFINE_Q35_MACHINE(v4_0_1, "pc-q35-4.0.1", NULL, - pc_q35_4_0_1_machine_options); +DEFINE_Q35_MACHINE_BUGFIX(4, 0, 1); =20 -static void pc_q35_4_0_machine_options(MachineClass *m) +static void pc_q35_machine_4_0_options(MachineClass *m) { - pc_q35_4_0_1_machine_options(m); + pc_q35_machine_4_0_1_options(m); m->default_kernel_irqchip_split =3D true; /* Compat props are applied by the 4.0.1 machine */ } =20 -DEFINE_Q35_MACHINE(v4_0, "pc-q35-4.0", NULL, - pc_q35_4_0_machine_options); +DEFINE_Q35_MACHINE(4, 0); =20 -static void pc_q35_3_1_machine_options(MachineClass *m) +static void pc_q35_machine_3_1_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); =20 - pc_q35_4_0_machine_options(m); + pc_q35_machine_4_0_options(m); m->default_kernel_irqchip_split =3D false; m->smbus_no_migration_support =3D true; pcmc->pvh_enabled =3D false; @@ -589,121 +565,110 @@ static void pc_q35_3_1_machine_options(MachineClass= *m) compat_props_add(m->compat_props, pc_compat_3_1, pc_compat_3_1_len); } =20 -DEFINE_Q35_MACHINE(v3_1, "pc-q35-3.1", NULL, - pc_q35_3_1_machine_options); +DEFINE_Q35_MACHINE(3, 1); =20 -static void pc_q35_3_0_machine_options(MachineClass *m) +static void pc_q35_machine_3_0_options(MachineClass *m) { - pc_q35_3_1_machine_options(m); + pc_q35_machine_3_1_options(m); compat_props_add(m->compat_props, hw_compat_3_0, hw_compat_3_0_len); compat_props_add(m->compat_props, pc_compat_3_0, pc_compat_3_0_len); } =20 -DEFINE_Q35_MACHINE(v3_0, "pc-q35-3.0", NULL, - pc_q35_3_0_machine_options); +DEFINE_Q35_MACHINE(3, 0); =20 -static void pc_q35_2_12_machine_options(MachineClass *m) +static void pc_q35_machine_2_12_options(MachineClass *m) { - pc_q35_3_0_machine_options(m); + pc_q35_machine_3_0_options(m); compat_props_add(m->compat_props, hw_compat_2_12, hw_compat_2_12_len); compat_props_add(m->compat_props, pc_compat_2_12, pc_compat_2_12_len); } =20 -DEFINE_Q35_MACHINE(v2_12, "pc-q35-2.12", NULL, - pc_q35_2_12_machine_options); +DEFINE_Q35_MACHINE(2, 12); =20 -static void pc_q35_2_11_machine_options(MachineClass *m) +static void pc_q35_machine_2_11_options(MachineClass *m) { - pc_q35_2_12_machine_options(m); + pc_q35_machine_2_12_options(m); m->default_nic =3D "e1000"; compat_props_add(m->compat_props, hw_compat_2_11, hw_compat_2_11_len); compat_props_add(m->compat_props, pc_compat_2_11, pc_compat_2_11_len); } =20 -DEFINE_Q35_MACHINE(v2_11, "pc-q35-2.11", NULL, - pc_q35_2_11_machine_options); +DEFINE_Q35_MACHINE(2, 11); =20 -static void pc_q35_2_10_machine_options(MachineClass *m) +static void pc_q35_machine_2_10_options(MachineClass *m) { - pc_q35_2_11_machine_options(m); + pc_q35_machine_2_11_options(m); compat_props_add(m->compat_props, hw_compat_2_10, hw_compat_2_10_len); compat_props_add(m->compat_props, pc_compat_2_10, pc_compat_2_10_len); m->auto_enable_numa_with_memhp =3D false; } =20 -DEFINE_Q35_MACHINE(v2_10, "pc-q35-2.10", NULL, - pc_q35_2_10_machine_options); +DEFINE_Q35_MACHINE(2, 10); =20 -static void pc_q35_2_9_machine_options(MachineClass *m) +static void pc_q35_machine_2_9_options(MachineClass *m) { - pc_q35_2_10_machine_options(m); + pc_q35_machine_2_10_options(m); compat_props_add(m->compat_props, hw_compat_2_9, hw_compat_2_9_len); compat_props_add(m->compat_props, pc_compat_2_9, pc_compat_2_9_len); } =20 -DEFINE_Q35_MACHINE(v2_9, "pc-q35-2.9", NULL, - pc_q35_2_9_machine_options); +DEFINE_Q35_MACHINE(2, 9); =20 -static void pc_q35_2_8_machine_options(MachineClass *m) +static void pc_q35_machine_2_8_options(MachineClass *m) { - pc_q35_2_9_machine_options(m); + pc_q35_machine_2_9_options(m); compat_props_add(m->compat_props, hw_compat_2_8, hw_compat_2_8_len); compat_props_add(m->compat_props, pc_compat_2_8, pc_compat_2_8_len); } =20 -DEFINE_Q35_MACHINE(v2_8, "pc-q35-2.8", NULL, - pc_q35_2_8_machine_options); +DEFINE_Q35_MACHINE(2, 8); =20 -static void pc_q35_2_7_machine_options(MachineClass *m) +static void pc_q35_machine_2_7_options(MachineClass *m) { - pc_q35_2_8_machine_options(m); + pc_q35_machine_2_8_options(m); m->max_cpus =3D 255; compat_props_add(m->compat_props, hw_compat_2_7, hw_compat_2_7_len); compat_props_add(m->compat_props, pc_compat_2_7, pc_compat_2_7_len); } =20 -DEFINE_Q35_MACHINE(v2_7, "pc-q35-2.7", NULL, - pc_q35_2_7_machine_options); +DEFINE_Q35_MACHINE(2, 7); =20 -static void pc_q35_2_6_machine_options(MachineClass *m) +static void pc_q35_machine_2_6_options(MachineClass *m) { X86MachineClass *x86mc =3D X86_MACHINE_CLASS(m); PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); =20 - pc_q35_2_7_machine_options(m); + pc_q35_machine_2_7_options(m); pcmc->legacy_cpu_hotplug =3D true; x86mc->fwcfg_dma_enabled =3D false; compat_props_add(m->compat_props, hw_compat_2_6, hw_compat_2_6_len); compat_props_add(m->compat_props, pc_compat_2_6, pc_compat_2_6_len); } =20 -DEFINE_Q35_MACHINE(v2_6, "pc-q35-2.6", NULL, - pc_q35_2_6_machine_options); +DEFINE_Q35_MACHINE(2, 6); =20 -static void pc_q35_2_5_machine_options(MachineClass *m) +static void pc_q35_machine_2_5_options(MachineClass *m) { X86MachineClass *x86mc =3D X86_MACHINE_CLASS(m); =20 - pc_q35_2_6_machine_options(m); + pc_q35_machine_2_6_options(m); x86mc->save_tsc_khz =3D false; m->legacy_fw_cfg_order =3D 1; compat_props_add(m->compat_props, hw_compat_2_5, hw_compat_2_5_len); compat_props_add(m->compat_props, pc_compat_2_5, pc_compat_2_5_len); } =20 -DEFINE_Q35_MACHINE(v2_5, "pc-q35-2.5", NULL, - pc_q35_2_5_machine_options); +DEFINE_Q35_MACHINE(2, 5); =20 -static void pc_q35_2_4_machine_options(MachineClass *m) +static void pc_q35_machine_2_4_options(MachineClass *m) { PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); =20 - pc_q35_2_5_machine_options(m); + pc_q35_machine_2_5_options(m); m->hw_version =3D "2.4.0"; pcmc->broken_reserved_end =3D true; compat_props_add(m->compat_props, hw_compat_2_4, hw_compat_2_4_len); compat_props_add(m->compat_props, pc_compat_2_4, pc_compat_2_4_len); } =20 -DEFINE_Q35_MACHINE(v2_4, "pc-q35-2.4", NULL, - pc_q35_2_4_machine_options); +DEFINE_Q35_MACHINE(2, 4); --=20 2.43.0 From nobody Mon Nov 25 01:54:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1718902779; cv=none; d=zohomail.com; s=zohoarc; b=R8DqLn3bD/EwrX9wurUqeDS75xcxxUKt7Dwf5QYtBdh7UuMieno2oZx6BRqwtVIK+pKhN843fPdAhSY5yHURjWacDqFBphd/AGV84ufQwWD2zies7vz/udaGJITQr9atqlW/2b+/a1CrkvbOAoybFKEc2SfnPK2nB1EW/i9CdY8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718902779; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=uaWjoLG2gOtVq/FVkDMOulCrYvJAR4cTwZqxuxD/9Cg=; b=W+qU/Ktd5DKnt/S0fWFTlJxvu40QaUET4hQ5/aQX4aB1s9gz9FSyL+dr3/3YIdIcCpyby+qtLHfVkOgh+Y/1182L70Co+uZp8t/2S22VTt/vLAAHccxPkhWrjCwAci/SirpnPfDDBsiNOCRynEVfFN/NREUu4mEysAFE4zInWns= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1718902779165829.5400511725741; Thu, 20 Jun 2024 09:59:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKL7z-0006q6-To; Thu, 20 Jun 2024 12:59:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL7y-0006ow-Ef for qemu-devel@nongnu.org; Thu, 20 Jun 2024 12:59:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL7w-00013w-LS for qemu-devel@nongnu.org; Thu, 20 Jun 2024 12:59:14 -0400 Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-605-OtrZOsfxM6mQM7wv9XEZaw-1; Thu, 20 Jun 2024 12:59:08 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 9764A19560B3; Thu, 20 Jun 2024 16:59:04 +0000 (UTC) Received: from toolbox.redhat.com (unknown [10.42.28.69]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0AC8A19560AF; Thu, 20 Jun 2024 16:58:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718902752; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uaWjoLG2gOtVq/FVkDMOulCrYvJAR4cTwZqxuxD/9Cg=; b=RdJPQsEnNOIS9CaCSteYrZ48IzIau+Wefie+vypwBlD6Kb3TwC+PLbMMpoD5lIvH0pGhdZ /CaN/tAVXdrq4DJIyymStEwDFZoPi8zClI0saBOunCWVffrsm4PXn5uSY3PcmeL6fogi4b BNDAaP63FFQvRrKQ8/0UrZ7F6JOjrb0= X-MC-Unique: OtrZOsfxM6mQM7wv9XEZaw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Halil Pasic , devel@lists.libvirt.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Eric Farman , qemu-s390x@nongnu.org, Richard Henderson , Nicholas Piggin , David Hildenbrand , Ilya Leoshkevich , David Gibson , qemu-arm@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora , Yanan Wang , Eduardo Habkost , Peter Maydell , Daniel Henrique Barboza , Thomas Huth , Paolo Bonzini , Marcel Apfelbaum , Christian Borntraeger , Laurent Vivier , qemu-ppc@nongnu.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 08/14] include/hw: add macros for deprecation & removal of versioned machines Date: Thu, 20 Jun 2024 17:57:36 +0100 Message-ID: <20240620165742.1711389-9-berrange@redhat.com> In-Reply-To: <20240620165742.1711389-1-berrange@redhat.com> References: <20240620165742.1711389-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.152, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1718902781027100007 Versioned machines live for a long time to provide back compat for incoming migration and restore of saved images. To guide users away from usage of old machines, however, we want to deprecate any older than 3 years (equiv of 9 releases), and delete any older than 6 years (equiva of 18 releases). To get a standardized deprecation message and avoid having to remember to manually add it after three years, this introduces two macros to be used by targets when defining versioned machines. * MACHINE_VER_DEPRECATION(major, minor) Automates the task of setting the 'deprecation_reason' field on the machine, if-and-only-if the major/minor version is older than 3 years. * MACHINE_VER_DELETION(major, minor) Simulates the deletion of by skipping registration of the QOM type for a versioned machine, if-and-only-if the major/minor version is older than 6 years. By using these two macros there is no longer any manual work required per-release to deprecate old machines. By preventing the use of machines that have reached their deletion date, it is also not necessary to manually delete machines per-release. Deletion can be batched up once a year or whenever makes most sense. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/boards.h | 96 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/include/hw/boards.h b/include/hw/boards.h index d5ad712585..187ed76646 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -429,6 +429,7 @@ struct MachineState { * MachineClass *mc =3D MACHINE_CLASS(oc); \ * MACHINE_VER_SYM(options, virt, __VA_ARGS__)(mc); \ * mc->desc =3D "QEMU " MACHINE_VER_STR(__VA_ARGS__) " Virtual Ma= chine"; \ + * MACHINE_VER_DEPRECATION(__VA_ARGS__); \ * if (latest) { \ * mc->alias =3D "virt"; \ * } \ @@ -440,6 +441,7 @@ struct MachineState { * }; \ * static void MACHINE_VER_SYM(register, virt, __VA_ARGS__)(void) \ * { \ + * MACHINE_VER_DELETION(__VA_ARGS__); \ * type_register_static(&MACHINE_VER_SYM(info, virt, __VA_ARGS__)= ); \ * } \ * type_init(MACHINE_VER_SYM(register, virt, __VA_ARGS__)); @@ -598,6 +600,100 @@ struct MachineState { _MACHINE_VER_SYM2) (sym, prefix, __VA_ARGS__) =20 =20 +/* + * How many years/major releases for each phase + * of the life cycle. Assumes use of versioning + * scheme where major is bumped each year + */ +#define MACHINE_VER_DELETION_MAJOR 6 +#define MACHINE_VER_DEPRECATION_MAJOR 3 + +/* + * Expands to a static string containing a deprecation + * message for a versioned machine type + */ +#define MACHINE_VER_DEPRECATION_MSG \ + "machines more than " stringify(MACHINE_VER_DEPRECATION_MAJOR) \ + " years old are subject to deletion after " \ + stringify(MACHINE_VER_DELETION_MAJOR) " years" + +#define _MACHINE_VER_IS_EXPIRED_IMPL(cutoff, major, minor) \ + (((QEMU_VERSION_MAJOR - major) > cutoff) || \ + (((QEMU_VERSION_MAJOR - major) =3D=3D cutoff) && \ + (QEMU_VERSION_MINOR - minor) >=3D 0)) + +#define _MACHINE_VER_IS_EXPIRED2(cutoff, major, minor) \ + _MACHINE_VER_IS_EXPIRED_IMPL(cutoff, major, minor) +#define _MACHINE_VER_IS_EXPIRED3(cutoff, major, minor, micro) \ + _MACHINE_VER_IS_EXPIRED_IMPL(cutoff, major, minor) +#define _MACHINE_VER_IS_EXPIRED4(cutoff, major, minor, _unused, tag) \ + _MACHINE_VER_IS_EXPIRED_IMPL(cutoff, major, minor) +#define _MACHINE_VER_IS_EXPIRED5(cutoff, major, minor, micro, _unused, tag= ) \ + _MACHINE_VER_IS_EXPIRED_IMPL(cutoff, major, minor) + +#define _MACHINE_IS_EXPIRED(cutoff, ...) \ + _MACHINE_VER_PICK(__VA_ARGS__, \ + _MACHINE_VER_IS_EXPIRED5, \ + _MACHINE_VER_IS_EXPIRED4, \ + _MACHINE_VER_IS_EXPIRED3, \ + _MACHINE_VER_IS_EXPIRED2) (cutoff, __VA_ARGS__) + +/* + * Evaluates true when a machine type with (major, minor) + * or (major, minor, micro) version should be considered + * deprecated based on the current versioned machine type + * lifecycle rules + */ +#define MACHINE_VER_IS_DEPRECATED(...) \ + _MACHINE_IS_EXPIRED(MACHINE_VER_DEPRECATION_MAJOR, __VA_ARGS__) + +/* + * Evaluates true when a machine type with (major, minor) + * or (major, minor, micro) version should be considered + * for deletion based on the current versioned machine type + * lifecycle rules + */ +#define MACHINE_VER_SHOULD_DELETE(...) \ + _MACHINE_IS_EXPIRED(MACHINE_VER_DELETION_MAJOR, __VA_ARGS__) + +/* + * Sets the deprecation reason for a versioned machine based + * on its age + * + * This must be unconditionally used in the _class_init + * function for all machine types which support versioning. + * + * Initially it will effectively be a no-op, but after a + * suitable period of time has passed, it will set the + * 'deprecation_reason' field on the machine, to warn users + * about forthcoming removal. + */ +#define MACHINE_VER_DEPRECATION(...) \ + do { \ + if (MACHINE_VER_IS_DEPRECATED(__VA_ARGS__)) { \ + mc->deprecation_reason =3D MACHINE_VER_DEPRECATION_MSG; \ + } \ + } while (0) + +/* + * Prevents registration of a versioned machined based on + * its age + * + * This must be unconditionally used in the register + * method for all machine types which support versioning. + * + * Inijtially it will effectively be a no-op, but after a + * suitable period of time has passed, it will cause + * execution of the method to return, avoiding registration + * of the machine + */ +#define MACHINE_VER_DELETION(...) \ + do { \ + if (MACHINE_VER_SHOULD_DELETE(__VA_ARGS__)) { \ + return; \ + } \ + } while (0) + #define DEFINE_MACHINE(namestr, machine_initfn) \ static void machine_initfn##_class_init(ObjectClass *oc, void *data) \ { \ --=20 2.43.0 From nobody Mon Nov 25 01:54:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1718902799; cv=none; d=zohomail.com; s=zohoarc; b=O+sJUm0nQiB+adrf0/6GZbi4dbhXsZrrgcFrPAbOTVg22mI/ClzKr47DTuvnYN4qJSYJSnbTCso9+2jbFjtat04l+KiUCa0EohbfXOOuMg8tRhxxp9+MItcMVeoTqmb7JZdXurECSp9Y3yuZIZHKV5ADHgkTYpmf7ry3GdHVnWs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718902799; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ktzPbwVOi3JvFl/Gc7vY9/eRCqcDsrTeLN6084ufJhI=; b=elqTl5IskR9IBhktKbkFrplPHCEcyGYjg8T+Hl37gY3OKkzGNRROXP3J0PWIUkZ/0NIp7B4EulWTZAUxObSUlF+jd3eIjFrm5oEQDSmVcoMYVZi/iGMoi1emq/PWodOzjBcO280POTmvMpLsX1qZ+gasyCGy/Eu5VDFe1KqGFN8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1718902799915426.9070398584495; Thu, 20 Jun 2024 09:59:59 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKL89-0006xk-Ck; Thu, 20 Jun 2024 12:59:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL87-0006wD-Dy for qemu-devel@nongnu.org; Thu, 20 Jun 2024 12:59:23 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL85-00014l-UG for qemu-devel@nongnu.org; Thu, 20 Jun 2024 12:59:23 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-353-3CpxUNziPd6U5coLl82dKQ-1; Thu, 20 Jun 2024 12:59:16 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BA6ED19560B5; Thu, 20 Jun 2024 16:59:13 +0000 (UTC) Received: from toolbox.redhat.com (unknown [10.42.28.69]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 26FBB19560AF; Thu, 20 Jun 2024 16:59:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718902761; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ktzPbwVOi3JvFl/Gc7vY9/eRCqcDsrTeLN6084ufJhI=; b=FalueFNcKNgPWjjVGW3DmexhAshce4qYo8cYwbFpWAmUe1KFAfGQjy7C3PKgO5PyntwrLJ vY8QKtW8WLywK9QgKn/O86SLuhjJCDFbB1aHG5pE/95cr0SmMhHxYPvQB9bbGQEjzkB1r+ 4+a4U9jonbvFxmKyof/k/PmsDYI9df8= X-MC-Unique: 3CpxUNziPd6U5coLl82dKQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Halil Pasic , devel@lists.libvirt.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Eric Farman , qemu-s390x@nongnu.org, Richard Henderson , Nicholas Piggin , David Hildenbrand , Ilya Leoshkevich , David Gibson , qemu-arm@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora , Yanan Wang , Eduardo Habkost , Peter Maydell , Daniel Henrique Barboza , Thomas Huth , Paolo Bonzini , Marcel Apfelbaum , Christian Borntraeger , Laurent Vivier , qemu-ppc@nongnu.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 09/14] include/hw: temporarily disable deletion of versioned machine types Date: Thu, 20 Jun 2024 17:57:37 +0100 Message-ID: <20240620165742.1711389-10-berrange@redhat.com> In-Reply-To: <20240620165742.1711389-1-berrange@redhat.com> References: <20240620165742.1711389-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.152, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1718902801132100001 The new deprecation and deletion policy for versioned machine types is being introduced in QEMU 9.1.0. Under the new policy a number of old machine types (any prior to 2.12) would be liable for immediate deletion which would be a violation of our historical deprecation and removal policy Thus automatic deletions (by skipping QOM registration) are temporarily gated on existance of the env variable "QEMU_DELETE_MACHINES" / QEMU version number >=3D 10.1.0. This allows opt-in testing of the automatic deletion logic, while activating it fully in QEMU >=3D 10.1.0. This whole commit should be reverted in the 10.1.0 dev cycle or shortly thereafter. Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Thomas Huth --- include/hw/boards.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index 187ed76646..ef6f18f2c1 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -686,11 +686,28 @@ struct MachineState { * suitable period of time has passed, it will cause * execution of the method to return, avoiding registration * of the machine + * + * The new deprecation and deletion policy for versioned + * machine types was introduced in QEMU 9.1.0. + * + * Under the new policy a number of old machine types (any + * prior to 2.12) would be liable for immediate deletion + * which would be a violation of our historical deprecation + * and removal policy + * + * Thus deletions are temporarily gated on existance of + * the env variable "QEMU_DELETE_MACHINES" / QEMU version + * number >=3D 10.1.0. This gate can be deleted in the 10.1.0 + * dev cycle */ #define MACHINE_VER_DELETION(...) \ do { \ if (MACHINE_VER_SHOULD_DELETE(__VA_ARGS__)) { \ - return; \ + if (getenv("QEMU_DELETE_MACHINES") || \ + QEMU_VERSION_MAJOR > 10 || (QEMU_VERSION_MAJOR =3D=3D 10 &= & \ + QEMU_VERSION_MINOR >=3D 1)) { \ + return; \ + } \ } \ } while (0) =20 --=20 2.43.0 From nobody Mon Nov 25 01:54:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1718903021; cv=none; d=zohomail.com; s=zohoarc; b=iZ8DPK5SCGqD8wdz8GxF42mfCx9YRlJjjbH1pPI9OidN3jGwLMxYvS81l48t0iEGoYe9mMuLFqZdSlUjwgpg8/7HMxRJ8OQUhhnhRoFBIvzTt7jkS0xYJRy2yKPlQ/LlU/sBGGoiQ9MWLRmJ5eplG7KO4LjK0RvnkjAGYLRSvQY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718903021; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=62rjxcJ3nmchiyP3ljOtuxEnPhE805Y+giHJJYqlDdU=; b=OriWuoGIKBr45N6lLHPocvaVoqTi9c7+wl6wvshmAaM9UtlxqYl1xgUPmuEUP33oIUyJAWVVDXkQhLckfiStqaabcRAnXITgnVTEi+4/FIiuQP6UPRCGWAn+rCcCyytyICo086/7ZIxYYBKxT9aWQRQr21loe/FPYOOCC0S14+c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1718903021661257.6791764607318; Thu, 20 Jun 2024 10:03:41 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKL8K-0008It-Jd; Thu, 20 Jun 2024 12:59:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL8J-00086C-A2 for qemu-devel@nongnu.org; Thu, 20 Jun 2024 12:59:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL8H-00018H-Jh for qemu-devel@nongnu.org; Thu, 20 Jun 2024 12:59:34 -0400 Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-63-3_hYD_v-Nm2FIUWa37YF8Q-1; Thu, 20 Jun 2024 12:59:27 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id BFC7219560A7; Thu, 20 Jun 2024 16:59:23 +0000 (UTC) Received: from toolbox.redhat.com (unknown [10.42.28.69]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 2D45519560AF; Thu, 20 Jun 2024 16:59:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718902772; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=62rjxcJ3nmchiyP3ljOtuxEnPhE805Y+giHJJYqlDdU=; b=QRajCCUCRkoHvKFBxkUCzdX3AAPPBWKSnVnhC6wBtiVmb4M9XAJgUrXKkDF6ep5yMUKscU XrJo0Jksurm91GIm9N8lVDBVD/ctvvcfx8WMkuERID5zYD6gD8CAr4cjXUU1rTrz2Ha/Pp d6WPDhoqt1BTpiRaIdvEFon4YwvNxw0= X-MC-Unique: 3_hYD_v-Nm2FIUWa37YF8Q-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Halil Pasic , devel@lists.libvirt.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Eric Farman , qemu-s390x@nongnu.org, Richard Henderson , Nicholas Piggin , David Hildenbrand , Ilya Leoshkevich , David Gibson , qemu-arm@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora , Yanan Wang , Eduardo Habkost , Peter Maydell , Daniel Henrique Barboza , Thomas Huth , Paolo Bonzini , Marcel Apfelbaum , Christian Borntraeger , Laurent Vivier , qemu-ppc@nongnu.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 10/14] hw: set deprecation info for all versioned machine types Date: Thu, 20 Jun 2024 17:57:38 +0100 Message-ID: <20240620165742.1711389-11-berrange@redhat.com> In-Reply-To: <20240620165742.1711389-1-berrange@redhat.com> References: <20240620165742.1711389-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.152, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1718903022733100001 This calls the MACHINE_VER_DEPRECATION() macro in the definition of all machine type classes which support versioning. This ensures that they will automatically get deprecation info set when they reach the appropriate point in their lifecycle. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/virt.c | 1 + hw/m68k/virt.c | 1 + hw/ppc/spapr.c | 1 + hw/s390x/s390-virtio-ccw.c | 1 + include/hw/i386/pc.h | 1 + 5 files changed, 5 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index a326aa24db..ef6591d914 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -110,6 +110,7 @@ static void arm_virt_compat_set(MachineClass *mc) arm_virt_compat_set(mc); \ MACHINE_VER_SYM(options, virt, __VA_ARGS__)(mc); \ mc->desc =3D "QEMU " MACHINE_VER_STR(__VA_ARGS__) " ARM Virtual Ma= chine"; \ + MACHINE_VER_DEPRECATION(__VA_ARGS__); \ if (latest) { \ mc->alias =3D "virt"; \ } \ diff --git a/hw/m68k/virt.c b/hw/m68k/virt.c index cd6ee692f7..37bb36b385 100644 --- a/hw/m68k/virt.c +++ b/hw/m68k/virt.c @@ -343,6 +343,7 @@ type_init(virt_machine_register_types) MachineClass *mc =3D MACHINE_CLASS(oc); \ MACHINE_VER_SYM(options, virt, __VA_ARGS__)(mc); \ mc->desc =3D "QEMU " MACHINE_VER_STR(__VA_ARGS__) " M68K Virtual M= achine"; \ + MACHINE_VER_DEPRECATION(__VA_ARGS__); \ if (latest) { \ mc->alias =3D "virt"; \ } \ diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 2785b6b303..55268489d3 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4811,6 +4811,7 @@ static void spapr_machine_latest_class_options(Machin= eClass *mc) { \ MachineClass *mc =3D MACHINE_CLASS(oc); \ MACHINE_VER_SYM(class_options, spapr, __VA_ARGS__)(mc); \ + MACHINE_VER_DEPRECATION(__VA_ARGS__); \ if (latest) { \ spapr_machine_latest_class_options(mc); \ } \ diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index efed539bc6..4cc7567872 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -825,6 +825,7 @@ static const TypeInfo ccw_machine_info =3D { MachineClass *mc =3D MACHINE_CLASS(oc); = \ MACHINE_VER_SYM(class_options, ccw, __VA_ARGS__)(mc); = \ mc->desc =3D "Virtual s390x machine (version " MACHINE_VER_STR(__V= A_ARGS__) ")"; \ + MACHINE_VER_DEPRECATION(__VA_ARGS__); = \ if (latest) { = \ mc->alias =3D "s390-ccw-virtio"; = \ mc->is_default =3D true; = \ diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 027c6f29f7..83d2e66498 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -330,6 +330,7 @@ extern const size_t pc_compat_2_3_len; MachineClass *mc =3D MACHINE_CLASS(oc); \ MACHINE_VER_SYM(options, namesym, __VA_ARGS__)(mc); \ mc->init =3D MACHINE_VER_SYM(init, namesym, __VA_ARGS__); \ + MACHINE_VER_DEPRECATION(__VA_ARGS__); \ } \ static const TypeInfo MACHINE_VER_SYM(info, namesym, __VA_ARGS__) =3D \ { \ --=20 2.43.0 From nobody Mon Nov 25 01:54:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1718902915; cv=none; d=zohomail.com; s=zohoarc; b=XSBAZJfdTWqnRSKimb0JqFsyEktvTV/ya5GGTY4vnQg/9s3OGLgt6nYitDA1pa8SAzmW80DzEpG8ngmRogdqzHC0s/wDYwZsxrq+ffYT/4AQRJDLLI0VbdgVohO5qq021QG+mPck2pZaRkzXqz85SQfWDWtF6LRvRuNqVN6NKL4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718902915; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8/owPdu5/iJ48Xgy+KKO46Gh3iwTxELUGA2Cx8B6spU=; b=Jbyj/KfkOFEgQLzgypzb4UyzK44lNcfRFYDwhi8YsDgKqfuFKtWmX30HqiGKOPOGGtIcl//FF5KysxTEnRgSKnnPW1P0Bex+fw1PbvKDQLPNx7AgV0Vqr8OSrqZpsg2ZqBgSXtpJODuwP1pvJ2XhS71nzw62oalBd3P5Y4OKISk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1718902915677533.1530173317931; Thu, 20 Jun 2024 10:01:55 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKL8W-0000Tk-E7; Thu, 20 Jun 2024 12:59:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL8R-0000Nq-5F for qemu-devel@nongnu.org; Thu, 20 Jun 2024 12:59:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL8O-0001BP-A6 for qemu-devel@nongnu.org; Thu, 20 Jun 2024 12:59:42 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-78-Hag_DufFMKSF0R3eIlsnVg-1; Thu, 20 Jun 2024 12:59:35 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 43C6F195608B; Thu, 20 Jun 2024 16:59:32 +0000 (UTC) Received: from toolbox.redhat.com (unknown [10.42.28.69]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 0657519560AF; Thu, 20 Jun 2024 16:59:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718902779; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8/owPdu5/iJ48Xgy+KKO46Gh3iwTxELUGA2Cx8B6spU=; b=fznILTsVclj4JJC7bITQfxFSbBONCaS7XaTB7Fmarl63QRYYYSUi8Mu3ogwMzjvi3HmT53 OW6EH6U61600HH3hy9FMKfyF+ckx9/sEosYf5NQX5BpxmAxYWDE61w74k89nUd9OAf/pjU 7sphEOanlnhMBhysGCBdmzJoplELGPQ= X-MC-Unique: Hag_DufFMKSF0R3eIlsnVg-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Halil Pasic , devel@lists.libvirt.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Eric Farman , qemu-s390x@nongnu.org, Richard Henderson , Nicholas Piggin , David Hildenbrand , Ilya Leoshkevich , David Gibson , qemu-arm@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora , Yanan Wang , Eduardo Habkost , Peter Maydell , Daniel Henrique Barboza , Thomas Huth , Paolo Bonzini , Marcel Apfelbaum , Christian Borntraeger , Laurent Vivier , qemu-ppc@nongnu.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 11/14] hw: skip registration of outdated versioned machine types Date: Thu, 20 Jun 2024 17:57:39 +0100 Message-ID: <20240620165742.1711389-12-berrange@redhat.com> In-Reply-To: <20240620165742.1711389-1-berrange@redhat.com> References: <20240620165742.1711389-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.152, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1718902916195100002 This calls the MACHINE_VER_DELETION() macro in the machine type registration method, so that when a versioned machine type reaches the end of its life, it is no longer registered with QOM and thus cannot be used. The actual definition of the machine type should be deleted at this point, but experience shows that can easily be forgotten. By skipping registration the manual code deletion task can be done at any later date. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/arm/virt.c | 1 + hw/m68k/virt.c | 1 + hw/ppc/spapr.c | 1 + hw/s390x/s390-virtio-ccw.c | 1 + include/hw/i386/pc.h | 1 + 5 files changed, 5 insertions(+) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index ef6591d914..ab4a0d9ed6 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -123,6 +123,7 @@ static void arm_virt_compat_set(MachineClass *mc) }; \ static void MACHINE_VER_SYM(register, virt, __VA_ARGS__)(void) \ { \ + MACHINE_VER_DELETION(__VA_ARGS__); \ type_register_static(&MACHINE_VER_SYM(info, virt, __VA_ARGS__)); \ } \ type_init(MACHINE_VER_SYM(register, virt, __VA_ARGS__)); diff --git a/hw/m68k/virt.c b/hw/m68k/virt.c index 37bb36b385..cda199af8f 100644 --- a/hw/m68k/virt.c +++ b/hw/m68k/virt.c @@ -356,6 +356,7 @@ type_init(virt_machine_register_types) }; \ static void MACHINE_VER_SYM(register, virt, __VA_ARGS__)(void) \ { \ + MACHINE_VER_DELETION(__VA_ARGS__); \ type_register_static(&MACHINE_VER_SYM(info, virt, __VA_ARGS__)); \ } \ type_init(MACHINE_VER_SYM(register, virt, __VA_ARGS__)); diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 55268489d3..044e6a8d9d 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4824,6 +4824,7 @@ static void spapr_machine_latest_class_options(Machin= eClass *mc) }; \ static void MACHINE_VER_SYM(register, spapr, __VA_ARGS__)(void) \ { \ + MACHINE_VER_DELETION(__VA_ARGS__); \ type_register(&MACHINE_VER_SYM(info, spapr, __VA_ARGS__)); \ } \ type_init(MACHINE_VER_SYM(register, spapr, __VA_ARGS__)) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 4cc7567872..0cb8c595a2 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -846,6 +846,7 @@ static const TypeInfo ccw_machine_info =3D { }; = \ static void MACHINE_VER_SYM(register, ccw, __VA_ARGS__)(void) = \ { = \ + MACHINE_VER_DELETION(__VA_ARGS__); = \ type_register_static(&MACHINE_VER_SYM(info, ccw, __VA_ARGS__)); = \ } = \ type_init(MACHINE_VER_SYM(register, ccw, __VA_ARGS__)) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index 83d2e66498..4e55d7ef6e 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -340,6 +340,7 @@ extern const size_t pc_compat_2_3_len; }; \ static void MACHINE_VER_SYM(register, namesym, __VA_ARGS__)(void) \ { \ + MACHINE_VER_DELETION(__VA_ARGS__); \ type_register(&MACHINE_VER_SYM(info, namesym, __VA_ARGS__)); \ } \ type_init(MACHINE_VER_SYM(register, namesym, __VA_ARGS__)); --=20 2.43.0 From nobody Mon Nov 25 01:54:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1718902957; cv=none; d=zohomail.com; s=zohoarc; b=ZqTAjKY/dHm7GrQ2ANf3bxaO7wBy6LbWI7SZvJSIVoTkIvzPIVXHSh1LO2r3RMPI7tULHTeyHgRT3LG4vT9uBSdwAYKBTHEDkqxUzmL9IPKuGEigeenChLjZrBsqxBCZ/jW4sJ5COJGeZSA2I1h8RzH/X26S0HRk508UvEYIW4k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718902957; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PCqeEU9R0Lgk24EKtyhDUIszFvtS8XZ0+TYWM5rTnZ8=; b=Fb1xcA1c8xpTqhkMtohEn2Z7NfPhyw9gn7XGEPYZVeOPc8uUJ92LR4AR1y16jBUyHgxGK1ruH/TbPq/NZ+s30TOB79LE14luxD8tzDMYUy+Od5WJe45NKL/Uq4WfM4pMSFynkKgpFI8hvqiAWZvCO6n48Tgj7czN0IEM9Om3Z3k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1718902957285388.29676644602023; Thu, 20 Jun 2024 10:02:37 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKL8b-0000jO-BZ; Thu, 20 Jun 2024 12:59:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL8Z-0000Xf-V8 for qemu-devel@nongnu.org; Thu, 20 Jun 2024 12:59:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL8Y-0001Ci-4j for qemu-devel@nongnu.org; Thu, 20 Jun 2024 12:59:51 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-149-5SNyE9TDMKm-lROsNJGFWw-1; Thu, 20 Jun 2024 12:59:44 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 5AC3419560B5; Thu, 20 Jun 2024 16:59:41 +0000 (UTC) Received: from toolbox.redhat.com (unknown [10.42.28.69]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id C4E9E19560B0; Thu, 20 Jun 2024 16:59:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718902789; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PCqeEU9R0Lgk24EKtyhDUIszFvtS8XZ0+TYWM5rTnZ8=; b=a8Oswd8/98GqerBsKSv9ZxHCHYWsTIR/9nYg7Fc/d5VXB4kN4uPYMdgy6GeZhphbcVVyq3 IeqWasScnmOGgqms5S7E8CXSaJjDLR1A3OQKxGB+ZpV0dme4xdcEQbyWrEA5kOxUVJ8rhG eNLoaqz7LN4AnfmAUdHG0RiSUqaFFSM= X-MC-Unique: 5SNyE9TDMKm-lROsNJGFWw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Halil Pasic , devel@lists.libvirt.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Eric Farman , qemu-s390x@nongnu.org, Richard Henderson , Nicholas Piggin , David Hildenbrand , Ilya Leoshkevich , David Gibson , qemu-arm@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora , Yanan Wang , Eduardo Habkost , Peter Maydell , Daniel Henrique Barboza , Thomas Huth , Paolo Bonzini , Marcel Apfelbaum , Christian Borntraeger , Laurent Vivier , qemu-ppc@nongnu.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 12/14] hw/ppc: remove obsolete manual deprecation reason string of spapr machines Date: Thu, 20 Jun 2024 17:57:40 +0100 Message-ID: <20240620165742.1711389-13-berrange@redhat.com> In-Reply-To: <20240620165742.1711389-1-berrange@redhat.com> References: <20240620165742.1711389-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.152, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1718902958433100001 The automatic deprecation mechanism introduced in the preceeding patches will mark every spapr machine upto and including 2.12 as deprecated. As such we can revert the manually added deprecation which was a subset: commit 1392617d35765d5d912625fbb5cab1ffbed8e140 Author: C=C3=A9dric Le Goater Date: Tue Jan 23 16:37:02 2024 +1000 spapr: Tag pseries-2.1 - 2.11 machines as deprecated Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/ppc/spapr.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 044e6a8d9d..98fa3aa6a8 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -5156,7 +5156,6 @@ static void spapr_machine_2_11_class_options(MachineC= lass *mc) spapr_machine_2_12_class_options(mc); smc->default_caps.caps[SPAPR_CAP_HTM] =3D SPAPR_CAP_ON; compat_props_add(mc->compat_props, hw_compat_2_11, hw_compat_2_11_len); - mc->deprecation_reason =3D "old and not maintained - use a 2.12+ versi= on"; } =20 DEFINE_SPAPR_MACHINE(2, 11); --=20 2.43.0 From nobody Mon Nov 25 01:54:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1718902911; cv=none; d=zohomail.com; s=zohoarc; b=FQGR8ppWApRefGBDChQ3d6Psv8e4C526fgbZbUR2mcmoR2ApHq8XAsM3o4KZIw5ukuGsmu6TXC3mItcEiQMKtbhq52wXeAmz580ZqHKWPO/iQoWRNcwIMANWxyWOefIssMX24D/AJRa3dU/jf5itZAlkjjsulzI+WvgUyXQ+HoM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718902911; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=6z+0EL1JZTnHpwLYAG/nApKKGSfdaAKYBCaJ5wx9O1A=; b=IH+3Kw/a6D5f4bSvWnJcZNnsjgoOtAQvkbN3zHGEkRFbwv2pYoTK/5PLtiOyIhQrxvsAlSG2OJf/RW71sBTjxGZLaCauyf0mUopzSddATsq2vx4EWO8f4pNGZHN5uSH9t+yz4+zHhrfnCLXYyF6+su4zUvW/hIQ0LoIifAfF4iQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1718902911627578.5080775781659; Thu, 20 Jun 2024 10:01:51 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKL8x-0001ES-FT; Thu, 20 Jun 2024 13:00:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL8j-00017F-Bv for qemu-devel@nongnu.org; Thu, 20 Jun 2024 13:00:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL8h-0001Df-OM for qemu-devel@nongnu.org; Thu, 20 Jun 2024 13:00:00 -0400 Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-240-RZf7vTpZPfGheaoTQ67l-Q-1; Thu, 20 Jun 2024 12:59:54 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id F0A8C1956083; Thu, 20 Jun 2024 16:59:49 +0000 (UTC) Received: from toolbox.redhat.com (unknown [10.42.28.69]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id E0E9919560AF; Thu, 20 Jun 2024 16:59:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718902799; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6z+0EL1JZTnHpwLYAG/nApKKGSfdaAKYBCaJ5wx9O1A=; b=RhbnJ5qbpPPItrNNLk9iyTKQZs7lq3Wzed0DZ5eWm5XYuCSVrVZnh6Oh7KcJ+rqQ55r5tn mrh83Ih7jJhtbMIf1uqSeJVv6rjj5sMnMkiALV6/ssN5D7z+Mfug1RhWd9OwHSmVwlWMKP CkXwR3pLS3dw3xEhRFIyLq+UIRbeEFU= X-MC-Unique: RZf7vTpZPfGheaoTQ67l-Q-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Halil Pasic , devel@lists.libvirt.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Eric Farman , qemu-s390x@nongnu.org, Richard Henderson , Nicholas Piggin , David Hildenbrand , Ilya Leoshkevich , David Gibson , qemu-arm@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora , Yanan Wang , Eduardo Habkost , Peter Maydell , Daniel Henrique Barboza , Thomas Huth , Paolo Bonzini , Marcel Apfelbaum , Christian Borntraeger , Laurent Vivier , qemu-ppc@nongnu.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 13/14] hw/i386: remove obsolete manual deprecation reason string of i440fx machines Date: Thu, 20 Jun 2024 17:57:41 +0100 Message-ID: <20240620165742.1711389-14-berrange@redhat.com> In-Reply-To: <20240620165742.1711389-1-berrange@redhat.com> References: <20240620165742.1711389-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.152, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1718902912156100001 The automatic deprecation mechanism introduced in the preceeding patches will mark every i440fx machine upto and including 2.12 as deprecated. As such we can revert the manually added deprecation introduced in: commit 792b4fdd4eb8197bd6eb9e80a1dfaf0cb3b54aeb Author: Philippe Mathieu-Daud=C3=A9 Date: Wed Feb 28 10:34:35 2024 +0100 hw/i386/pc: Deprecate 2.4 to 2.12 pc-i440fx machines Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/i386/pc_piix.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 5705d6e155..9445b07b4f 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -688,7 +688,6 @@ DEFINE_I440FX_MACHINE(3, 0); static void pc_i440fx_machine_2_12_options(MachineClass *m) { pc_i440fx_machine_3_0_options(m); - m->deprecation_reason =3D "old and unattended - use a newer version in= stead"; compat_props_add(m->compat_props, hw_compat_2_12, hw_compat_2_12_len); compat_props_add(m->compat_props, pc_compat_2_12, pc_compat_2_12_len); } --=20 2.43.0 From nobody Mon Nov 25 01:54:36 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1718903007; cv=none; d=zohomail.com; s=zohoarc; b=DDMsb9xfsdatxEMqPV75DTrMmaF7xKpqg/ssMYXl4Pc3r5P6tXhojMM3oCEipGGqV7rV3mVSACYOnMhZdFq/LPJyZNgnx3GThb/1a4QulPOZMDLBXZm/+w+/JWBHMlT/X+Os/9sU0nDM1Kg/mpSF0Y09156JMLScAqWRgbCtqVw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1718903007; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cp5hTDyX0yXK7RBKij04gMtATUSvfKAIAWpFR+x0kC4=; b=WGksGGunq4sS3dmHRReTSr0Gk6q8aewlj+Mxm65ur5PNeqEEJqhFPYmE0Uo4Xd5Rhje4HdUqO+n/jg3wWnVmZ7PDeAjxaKvZ29x2rMVhaCpneiwbus9/I3nhID0SKjEqSawI/9nIPIfZXqGLS7D4wzCl8vV8KrXD+Ql4EKFOo3Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1718903007573453.259898875114; Thu, 20 Jun 2024 10:03:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKL9K-0001vx-A4; Thu, 20 Jun 2024 13:00:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL8z-0001L5-Mf for qemu-devel@nongnu.org; Thu, 20 Jun 2024 13:00:20 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sKL8x-0001Qh-DO for qemu-devel@nongnu.org; Thu, 20 Jun 2024 13:00:17 -0400 Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-171-BEtTyNoYMYGeIfmCQyYrJQ-1; Thu, 20 Jun 2024 13:00:04 -0400 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 8C66F19560B8; Thu, 20 Jun 2024 17:00:01 +0000 (UTC) Received: from toolbox.redhat.com (unknown [10.42.28.69]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 66BC019560AF; Thu, 20 Jun 2024 16:59:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718902810; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cp5hTDyX0yXK7RBKij04gMtATUSvfKAIAWpFR+x0kC4=; b=SzKl6syugq8EMAQUL4LMAPrQBnnjNMmsHjxYaVIahyR0OClCB/AUEYFFBTKaDUDUroIqkk /DCTuia4tolGvLY7gvPJK+qdR2oNN2BcxHUVs8UDBYc504WSEJDAb9zeNPUkC1qzvvVqoV hZs6pGOSoMQB/U4vzchwv5F6wV1+n54= X-MC-Unique: BEtTyNoYMYGeIfmCQyYrJQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: qemu-devel@nongnu.org Cc: Halil Pasic , devel@lists.libvirt.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "Michael S. Tsirkin" , Eric Farman , qemu-s390x@nongnu.org, Richard Henderson , Nicholas Piggin , David Hildenbrand , Ilya Leoshkevich , David Gibson , qemu-arm@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Harsh Prateek Bora , Yanan Wang , Eduardo Habkost , Peter Maydell , Daniel Henrique Barboza , Thomas Huth , Paolo Bonzini , Marcel Apfelbaum , Christian Borntraeger , Laurent Vivier , qemu-ppc@nongnu.org, =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Subject: [PATCH v2 14/14] docs: document special exception for machine type deprecation & removal Date: Thu, 20 Jun 2024 17:57:42 +0100 Message-ID: <20240620165742.1711389-15-berrange@redhat.com> In-Reply-To: <20240620165742.1711389-1-berrange@redhat.com> References: <20240620165742.1711389-1-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=berrange@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 11 X-Spam_score: 1.1 X-Spam_bar: + X-Spam_report: (1.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.152, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1718903008655100005 This extends the deprecation policy to indicate that versioned machine types will be marked deprecated after 3 years, and then subject to removal after a further 3 years has passed. Reviewed-by: Thomas Huth Signed-off-by: Daniel P. Berrang=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- docs/about/deprecated.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst index ff3da68208..bba12d1641 100644 --- a/docs/about/deprecated.rst +++ b/docs/about/deprecated.rst @@ -11,6 +11,19 @@ releases, the feature is liable to be removed. Deprecate= d features may also generate warnings on the console when QEMU starts up, or if activated via a monitor command, however, this is not a mandatory requirement. =20 +As a special exception to this general timeframe, rather than have an +indefinite lifetime, versioned machine types are only intended to be +supported for a period of 6 years, equivalent to 18 QEMU releases. All +versioned machine types will be automatically marked deprecated after an +initial 3 years (9 QEMU releases) has passed, and will then be deleted aft= er +a further 3 year period has passed. It is recommended that a deprecated +machine type is only used for incoming migrations and restore of saved sta= te, +for pre-existing VM deployments. They should be scheduled for updating to a +newer machine type during an appropriate service window. Newly deployed VMs +should exclusively use a non-deprecated machine type, with use of the most +recent version highly recommended. Non-versioned machine types follow the +general feature deprecation policy. + Prior to the 2.10.0 release there was no official policy on how long features would be deprecated prior to their removal, nor any documented list of which features were deprecated. Thus --=20 2.43.0