From nobody Thu Nov 6 10:26:49 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 1540898198169954.2749303353994; Tue, 30 Oct 2018 04:16:38 -0700 (PDT) Received: from localhost ([::1]:52186 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHS0i-0002WK-QE for importer@patchew.org; Tue, 30 Oct 2018 07:16:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHRyC-0000xt-JT for qemu-devel@nongnu.org; Tue, 30 Oct 2018 07:14:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHRy9-00084z-0M for qemu-devel@nongnu.org; Tue, 30 Oct 2018 07:14:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49687) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gHRy8-00081P-DP; Tue, 30 Oct 2018 07:13:56 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6D9B658E39; Tue, 30 Oct 2018 11:13:54 +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 8B18F5C207; Tue, 30 Oct 2018 11:13:49 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 6B81716444F; Tue, 30 Oct 2018 12:13:48 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 30 Oct 2018 12:13:45 +0100 Message-Id: <20181030111348.14713-2-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.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 30 Oct 2018 11:13:54 +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 1/4] add 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" Indicates support state for somerhing (device, backend, subsystem, ...) in qemu. Modeled roughly after the "S:" states we have in MAINTANERS. Signed-off-by: Gerd Hoffmann Acked-by: Paolo Bonzini --- include/qemu/support-state.h | 17 +++++++++++++++++ util/support-state.c | 23 +++++++++++++++++++++++ qapi/common.json | 16 ++++++++++++++++ util/Makefile.objs | 1 + 4 files changed, 57 insertions(+) create mode 100644 include/qemu/support-state.h create mode 100644 util/support-state.c diff --git a/include/qemu/support-state.h b/include/qemu/support-state.h new file mode 100644 index 0000000000..5fd3c83eee --- /dev/null +++ b/include/qemu/support-state.h @@ -0,0 +1,17 @@ +#ifndef QEMU_SUPPORT_STATE_H +#define QEMU_SUPPORT_STATE_H + +#include "qapi/qapi-types-common.h" + +typedef struct QemuSupportState { + SupportState state; + const char *reason; +} QemuSupportState; + +void qemu_warn_support_state(const char *type, const char *name, + QemuSupportState *state); + +bool qemu_is_deprecated(QemuSupportState *state); +bool qemu_is_obsolete(QemuSupportState *state); + +#endif /* QEMU_SUPPORT_STATE_H */ diff --git a/util/support-state.c b/util/support-state.c new file mode 100644 index 0000000000..7966fa0fc7 --- /dev/null +++ b/util/support-state.c @@ -0,0 +1,23 @@ +#include "qemu/osdep.h" +#include "qemu/error-report.h" +#include "qemu/support-state.h" + +void qemu_warn_support_state(const char *type, const char *name, + QemuSupportState *state) +{ + warn_report("%s %s is %s%s%s%s", type, name, + SupportState_str(state->state), + state->reason ? " (" : "", + state->reason ? state->reason : "", + state->reason ? ")" : ""); +} + +bool qemu_is_deprecated(QemuSupportState *state) +{ + return state->state =3D=3D SUPPORT_STATE_DEPRECATED; +} + +bool qemu_is_obsolete(QemuSupportState *state) +{ + return state->state =3D=3D SUPPORT_STATE_OBSOLETE; +} diff --git a/qapi/common.json b/qapi/common.json index 021174f04e..78176151af 100644 --- a/qapi/common.json +++ b/qapi/common.json @@ -151,3 +151,19 @@ 'ppc64', 'riscv32', 'riscv64', 's390x', 'sh4', 'sh4eb', 'sparc', 'sparc64', 'tricore', 'unicore32', 'x86_64', 'xtensa', 'xtensaeb' ] } + +## +# @SupportState: +# +# Indicate Support level of qemu devices, backends, subsystems, ... +# +# Since: 3.2 +## +{ 'enum': 'SupportState', + 'data': [ 'unknown', + 'supported', + 'maintained', + 'odd-fixes', + 'orphan', + 'obsolete', + 'deprecated' ] } diff --git a/util/Makefile.objs b/util/Makefile.objs index 0820923c18..6e5f8faf82 100644 --- a/util/Makefile.objs +++ b/util/Makefile.objs @@ -50,5 +50,6 @@ util-obj-y +=3D range.o util-obj-y +=3D stats64.o util-obj-y +=3D systemd.o util-obj-y +=3D iova-tree.o +util-obj-y +=3D support-state.o util-obj-$(CONFIG_LINUX) +=3D vfio-helpers.o util-obj-$(CONFIG_OPENGL) +=3D drm.o --=20 2.9.3 From nobody Thu Nov 6 10:26:49 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 1540898172319630.5105934181918; Tue, 30 Oct 2018 04:16:12 -0700 (PDT) Received: from localhost ([::1]:52183 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHS0E-0002BC-UM for importer@patchew.org; Tue, 30 Oct 2018 07:16:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53670) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHRyC-0000xu-LB for qemu-devel@nongnu.org; Tue, 30 Oct 2018 07:14:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHRy9-00085Y-6r for qemu-devel@nongnu.org; Tue, 30 Oct 2018 07:14:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33590) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gHRy8-00083d-Ri; Tue, 30 Oct 2018 07:13:57 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BD85530AAD69; Tue, 30 Oct 2018 11:13:55 +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 961791055008; Tue, 30 Oct 2018 11:13:49 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 7CCD0164452; Tue, 30 Oct 2018 12:13:48 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 30 Oct 2018 12:13:46 +0100 Message-Id: <20181030111348.14713-3-kraxel@redhat.com> In-Reply-To: <20181030111348.14713-1-kraxel@redhat.com> References: <20181030111348.14713-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 30 Oct 2018 11:13:55 +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 2/4] add QemuSupportState to DeviceClass 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 tag device support state. Signed-off-by: Gerd Hoffmann Acked-by: Paolo Bonzini --- include/hw/qdev-core.h | 2 ++ hw/core/qdev.c | 8 +++++++- qdev-monitor.c | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index a24d0dd566..ff6bd3f08f 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -3,6 +3,7 @@ =20 #include "qemu/queue.h" #include "qemu/bitmap.h" +#include "qemu/support-state.h" #include "qom/object.h" #include "hw/irq.h" #include "hw/hotplug.h" @@ -105,6 +106,7 @@ typedef struct DeviceClass { */ bool user_creatable; bool hotpluggable; + QemuSupportState supported; =20 /* callbacks */ DeviceReset reset; diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 6b3cc55b27..e788fca257 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -133,11 +133,17 @@ DeviceState *qdev_create(BusState *bus, const char *n= ame) =20 DeviceState *qdev_try_create(BusState *bus, const char *type) { + DeviceClass *dc; DeviceState *dev; =20 - if (object_class_by_name(type) =3D=3D NULL) { + dc =3D DEVICE_CLASS(object_class_by_name(type)); + if (dc =3D=3D NULL) { return NULL; } + if (qemu_is_deprecated(&dc->supported) || + qemu_is_obsolete(&dc->supported)) { + qemu_warn_support_state("device", type, &dc->supported); + } dev =3D DEVICE(object_new(type)); if (!dev) { return NULL; diff --git a/qdev-monitor.c b/qdev-monitor.c index 802c18a74e..63cb43691c 100644 --- a/qdev-monitor.c +++ b/qdev-monitor.c @@ -128,6 +128,9 @@ static void qdev_print_devinfo(DeviceClass *dc) if (!dc->user_creatable) { out_printf(", no-user"); } + if (dc->supported.state !=3D SUPPORT_STATE_UNKNOWN) { + out_printf(", %s", SupportState_str(dc->supported.state)); + } out_printf("\n"); } =20 @@ -579,6 +582,10 @@ DeviceState *qdev_device_add(QemuOpts *opts, Error **e= rrp) if (!dc) { return NULL; } + if (qemu_is_deprecated(&dc->supported) || + qemu_is_obsolete(&dc->supported)) { + qemu_warn_support_state("device", driver, &dc->supported); + } =20 /* find bus */ path =3D qemu_opt_get(opts, "bus"); --=20 2.9.3 From nobody Thu Nov 6 10:26:49 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 154089835600886.56792884943366; Tue, 30 Oct 2018 04:19:16 -0700 (PDT) Received: from localhost ([::1]:52199 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHS3G-0005j1-Ig for importer@patchew.org; Tue, 30 Oct 2018 07:19:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53659) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHRyC-0000xr-Ib for qemu-devel@nongnu.org; Tue, 30 Oct 2018 07:14:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHRy9-00085D-1f for qemu-devel@nongnu.org; Tue, 30 Oct 2018 07:14:00 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20156) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gHRy8-00081O-ID; Tue, 30 Oct 2018 07:13:56 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6A8D52DF94; Tue, 30 Oct 2018 11:13:54 +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 964105D9D6; Tue, 30 Oct 2018 11:13:49 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 8CB9D164458; Tue, 30 Oct 2018 12:13:48 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 30 Oct 2018 12:13:47 +0100 Message-Id: <20181030111348.14713-4-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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 30 Oct 2018 11:13:54 +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 3/4] tag cirrus as obsolete 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" Standard VGA should be used instead. Signed-off-by: Gerd Hoffmann Acked-by: Paolo Bonzini --- hw/display/cirrus_vga.c | 3 +++ hw/display/cirrus_vga_isa.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c index d9b854d74d..ec2cefb46f 100644 --- a/hw/display/cirrus_vga.c +++ b/hw/display/cirrus_vga.c @@ -3024,6 +3024,9 @@ static void cirrus_vga_class_init(ObjectClass *klass,= void *data) dc->vmsd =3D &vmstate_pci_cirrus_vga; dc->props =3D pci_vga_cirrus_properties; dc->hotpluggable =3D false; + dc->supported.state =3D SUPPORT_STATE_OBSOLETE; + dc->supported.reason =3D "use \"-vga std\" instead, see " + "https://www.kraxel.org/blog/2014/10/qemu-using-cirrus-considered-= harmful/"; } =20 static const TypeInfo cirrus_vga_info =3D { diff --git a/hw/display/cirrus_vga_isa.c b/hw/display/cirrus_vga_isa.c index fa10b74230..cfe2cad9e0 100644 --- a/hw/display/cirrus_vga_isa.c +++ b/hw/display/cirrus_vga_isa.c @@ -81,6 +81,9 @@ static void isa_cirrus_vga_class_init(ObjectClass *klass,= void *data) dc->realize =3D isa_cirrus_vga_realizefn; dc->props =3D isa_cirrus_vga_properties; set_bit(DEVICE_CATEGORY_DISPLAY, dc->categories); + dc->supported.state =3D SUPPORT_STATE_OBSOLETE; + dc->supported.reason =3D "use \"-vga std\" instead, see " + "https://www.kraxel.org/blog/2014/10/qemu-using-cirrus-considered-= harmful/"; } =20 static const TypeInfo isa_cirrus_vga_info =3D { --=20 2.9.3 From nobody Thu Nov 6 10:26:49 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 Acked-by: Paolo Bonzini --- 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