From nobody Thu Nov 6 12:13: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 1540898173808667.7417955630261; Tue, 30 Oct 2018 04:16:13 -0700 (PDT) Received: from localhost ([::1]:52184 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHS0K-0002HS-K4 for importer@patchew.org; Tue, 30 Oct 2018 07:16:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53753) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHRyE-0000ys-3f for qemu-devel@nongnu.org; Tue, 30 Oct 2018 07:14:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHRyB-0008A2-BE for qemu-devel@nongnu.org; Tue, 30 Oct 2018 07:14:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56383) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gHRyA-00086o-QW; Tue, 30 Oct 2018 07:13:59 -0400 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 9B36D2D4B66; Tue, 30 Oct 2018 11:13:57 +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 964F2608F2; Tue, 30 Oct 2018 11:13:49 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A105716A879; Tue, 30 Oct 2018 12:13:48 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 30 Oct 2018 12:13:48 +0100 Message-Id: <20181030111348.14713-5-kraxel@redhat.com> In-Reply-To: <20181030111348.14713-1-kraxel@redhat.com> References: <20181030111348.14713-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.29]); Tue, 30 Oct 2018 11:13:57 +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 4/4] switch machine types to QemuSupportState 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 , 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" So we can indicate machine type support state. For starters switch over the current deprecation_reason users. Signed-off-by: Gerd Hoffmann --- include/hw/boards.h | 5 ++--- hw/i386/pc_piix.c | 3 ++- hw/ppc/prep.c | 3 ++- vl.c | 6 +++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index f82f28468b..25e5d8b292 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -106,8 +106,7 @@ 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. + * @supported: support state of the machine type. * @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 +166,7 @@ struct MachineClass { char *name; const char *alias; const char *desc; - const char *deprecation_reason; + QemuSupportState supported; =20 void (*init)(MachineState *state); void (*reset)(void); diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index dc09466b3e..bc238cc465 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -957,7 +957,8 @@ static void pc_i440fx_0_11_machine_options(MachineClass= *m) { pc_i440fx_0_12_machine_options(m); m->hw_version =3D "0.11"; - m->deprecation_reason =3D "use a newer machine type instead"; + m->supported.state =3D SUPPORT_STATE_DEPRECATED; + m->supported.reason =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..ab1c2bcc7d 100644 --- a/hw/ppc/prep.c +++ b/hw/ppc/prep.c @@ -588,7 +588,8 @@ static void ppc_prep_init(MachineState *machine) =20 static void prep_machine_init(MachineClass *mc) { - mc->deprecation_reason =3D "use 40p machine type instead"; + mc->supported.state =3D SUPPORT_STATE_DEPRECATED; + mc->supported.reason =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..83506de0cc 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(&mc->supported) ? " (deprecated)" : = ""); } } =20 @@ -4290,9 +4290,9 @@ 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(&machine_class->supported))= { error_report("Machine type '%s' is deprecated: %s", - machine_class->name, machine_class->deprecation_reaso= n); + machine_class->name, machine_class->supported.reason); } =20 /* --=20 2.9.3