From nobody Thu Nov 6 12:14:09 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 154150120102865.35679897324951; Tue, 6 Nov 2018 02:46:41 -0800 (PST) Received: from localhost ([::1]:40176 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJysa-00088W-1D for importer@patchew.org; Tue, 06 Nov 2018 05:46:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39181) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJykL-0005QJ-Vj for qemu-devel@nongnu.org; Tue, 06 Nov 2018 05:38:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJyWQ-0005HC-KE for qemu-devel@nongnu.org; Tue, 06 Nov 2018 05:23:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42220) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gJyWQ-0005GW-9f; Tue, 06 Nov 2018 05:23:46 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6A286307EA90; Tue, 6 Nov 2018 10:23:45 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-158.ams2.redhat.com [10.36.116.158]) by smtp.corp.redhat.com (Postfix) with ESMTP id 93373611D3; Tue, 6 Nov 2018 10:23:36 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B8C5C8FAD; Tue, 6 Nov 2018 11:23:35 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 6 Nov 2018 11:23:32 +0100 Message-Id: <20181106102335.20027-4-kraxel@redhat.com> In-Reply-To: <20181106102335.20027-1-kraxel@redhat.com> References: <20181106102335.20027-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Tue, 06 Nov 2018 10:23:45 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v2 3/6] Use QemuSupportState for machine types. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , "Michael S. Tsirkin" , Alexander Graf , Markus Armbruster , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , qemu-ppc@nongnu.org, Gerd Hoffmann , Paolo Bonzini , Richard Henderson , =?UTF-8?q?Andreas=20F=C3=A4rber?= , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Switch over the current deprecation_reason users to use the QemuSupportState field in ObjectClass instead. Signed-off-by: Gerd Hoffmann --- include/hw/boards.h | 3 --- hw/i386/pc_piix.c | 5 ++++- hw/ppc/prep.c | 5 ++++- vl.c | 7 ++++--- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index f82f28468b..b7bb181fc8 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -106,8 +106,6 @@ typedef struct { =20 /** * MachineClass: - * @deprecation_reason: If set, the machine is marked as deprecated. The - * string should provide some clear information about what to use inste= ad. * @max_cpus: maximum number of CPUs supported. Default: 1 * @min_cpus: minimum number of CPUs supported. Default: 1 * @default_cpus: number of CPUs instantiated if none are specified. Defau= lt: 1 @@ -167,7 +165,6 @@ struct MachineClass { char *name; const char *alias; const char *desc; - const char *deprecation_reason; =20 void (*init)(MachineState *state); void (*reset)(void); diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index dc09466b3e..407f4503a3 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -955,9 +955,12 @@ DEFINE_I440FX_MACHINE(v0_12, "pc-0.12", pc_compat_0_13, =20 static void pc_i440fx_0_11_machine_options(MachineClass *m) { + ObjectClass *oc =3D OBJECT_CLASS(m); + pc_i440fx_0_12_machine_options(m); m->hw_version =3D "0.11"; - m->deprecation_reason =3D "use a newer machine type instead"; + oc->supported.state =3D SUPPORT_STATE_DEPRECATED; + oc->supported.help =3D "use a newer machine type instead"; SET_MACHINE_COMPAT(m, PC_COMPAT_0_11); } =20 diff --git a/hw/ppc/prep.c b/hw/ppc/prep.c index 2afb7f437e..260700847b 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -588,7 +588,10 @@ static void ppc_prep_init(MachineState *machine) =20 static void prep_machine_init(MachineClass *mc) { - mc->deprecation_reason =3D "use 40p machine type instead"; + ObjectClass *oc =3D OBJECT_CLASS(mc); + + oc->supported.state =3D SUPPORT_STATE_DEPRECATED; + oc->supported.help =3D "use 40p machine type instead"; mc->desc =3D "PowerPC PREP platform"; mc->init =3D ppc_prep_init; mc->block_default_type =3D IF_IDE; diff --git a/vl.c b/vl.c index 1fcacc5caa..ba81fefb66 100644 --- a/vl.c +++ b/vl.c @@ -2573,7 +2573,7 @@ static gint machine_class_cmp(gconstpointer a, gconst= pointer b) } printf("%-20s %s%s%s\n", mc->name, mc->desc, mc->is_default ? " (default)" : "", - mc->deprecation_reason ? " (deprecated)" : ""); + qemu_is_deprecated(OBJECT_CLASS(mc)) ? " (deprecated)" = : ""); } } =20 @@ -4290,9 +4290,10 @@ int main(int argc, char **argv, char **envp) =20 configure_accelerator(current_machine); =20 - if (!qtest_enabled() && machine_class->deprecation_reason) { + if (!qtest_enabled() && qemu_is_deprecated(OBJECT_CLASS(machine_class)= )) { error_report("Machine type '%s' is deprecated: %s", - machine_class->name, machine_class->deprecation_reaso= n); + machine_class->name, + OBJECT_CLASS(machine_class)->supported.help); } =20 /* --=20 2.9.3