From nobody Thu Nov 6 10:20:12 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 1541500913845588.6440921770627; Tue, 6 Nov 2018 02:41:53 -0800 (PST) Received: from localhost ([::1]:40142 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJynw-0002Bi-Jb for importer@patchew.org; Tue, 06 Nov 2018 05:41:52 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJykC-0005qg-NQ for qemu-devel@nongnu.org; Tue, 06 Nov 2018 05:38:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJyWT-0005OC-Qv for qemu-devel@nongnu.org; Tue, 06 Nov 2018 05:23:52 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41152) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gJyWT-0005Ms-Kb; Tue, 06 Nov 2018 05:23:49 -0500 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 BD3F330820E3; Tue, 6 Nov 2018 10:23:48 +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 C7A7E17D99; Tue, 6 Nov 2018 10:23:36 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id A0F1B8FAB; Tue, 6 Nov 2018 11:23:35 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 6 Nov 2018 11:23:30 +0100 Message-Id: <20181106102335.20027-2-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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Tue, 06 Nov 2018 10:23:48 +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 1/6] move ObjectClass to typedefs.h 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" Signed-off-by: Gerd Hoffmann Reviewed-by: David Gibson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- include/qemu/typedefs.h | 1 + include/qom/object.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index 3ec0e13a96..fed53f6de2 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -62,6 +62,7 @@ typedef struct NetClientState NetClientState; typedef struct NetFilterState NetFilterState; typedef struct NICInfo NICInfo; typedef struct NumaNodeMem NumaNodeMem; +typedef struct ObjectClass ObjectClass; typedef struct PCIBridge PCIBridge; typedef struct PCIBus PCIBus; typedef struct PCIDevice PCIDevice; diff --git a/include/qom/object.h b/include/qom/object.h index f0b0bf39cc..499e1fd8b7 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -20,7 +20,6 @@ struct TypeImpl; typedef struct TypeImpl *Type; =20 -typedef struct ObjectClass ObjectClass; typedef struct Object Object; =20 typedef struct TypeInfo TypeInfo; --=20 2.9.3 From nobody Thu Nov 6 10:20:12 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 1541500900165104.61801526609099; Tue, 6 Nov 2018 02:41:40 -0800 (PST) Received: from localhost ([::1]:40139 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJynj-00020l-2D for importer@patchew.org; Tue, 06 Nov 2018 05:41:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39266) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJykL-0005Vt-PW 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 1gJyWO-0005Dw-C5 for qemu-devel@nongnu.org; Tue, 06 Nov 2018 05:23:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:33248) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gJyWO-000526-2c; Tue, 06 Nov 2018 05:23:44 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C4CDB85A04; Tue, 6 Nov 2018 10:23:37 +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 C809E19751; Tue, 6 Nov 2018 10:23:36 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id AD5828FAC; Tue, 6 Nov 2018 11:23:35 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 6 Nov 2018 11:23:31 +0100 Message-Id: <20181106102335.20027-3-kraxel@redhat.com> In-Reply-To: <20181106102335.20027-1-kraxel@redhat.com> References: <20181106102335.20027-1-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 06 Nov 2018 10:23:37 +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 2/6] 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 , =?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" Indicates support state for something (device, backend, subsystem, ...) in qemu. Add QemuSupportState field to ObjectClass. Add some support code. TODO: wire up to qom-list-types Signed-off-by: Gerd Hoffmann --- include/qemu/support-state.h | 17 +++++++++++++++++ include/qom/object.h | 3 +++ util/support-state.c | 26 ++++++++++++++++++++++++++ qapi/common.json | 32 ++++++++++++++++++++++++++++++++ util/Makefile.objs | 1 + 5 files changed, 79 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..6567d8702b --- /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 *help; +} QemuSupportState; + +void qemu_warn_support_state(const char *type, const char *name, + ObjectClass *oc); + +bool qemu_is_deprecated(ObjectClass *oc); +bool qemu_is_obsolete(ObjectClass *oc); + +#endif /* QEMU_SUPPORT_STATE_H */ diff --git a/include/qom/object.h b/include/qom/object.h index 499e1fd8b7..2b5f27bf85 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -15,6 +15,7 @@ #define QEMU_OBJECT_H =20 #include "qapi/qapi-builtin-types.h" +#include "qemu/support-state.h" #include "qemu/queue.h" =20 struct TypeImpl; @@ -399,6 +400,8 @@ struct ObjectClass ObjectUnparent *unparent; =20 GHashTable *properties; + + QemuSupportState supported; }; =20 /** diff --git a/util/support-state.c b/util/support-state.c new file mode 100644 index 0000000000..3170dbd15d --- /dev/null +++ b/util/support-state.c @@ -0,0 +1,26 @@ +#include "qemu/osdep.h" +#include "qemu/error-report.h" +#include "qemu/support-state.h" +#include "qom/object.h" + +void qemu_warn_support_state(const char *type, const char *name, + ObjectClass *oc) +{ + const char *help =3D oc->supported.help; + + warn_report("%s %s is %s%s%s%s", type, name, + SupportState_str(oc->supported.state), + help ? " (" : "", + help ? help : "", + help ? ")" : ""); +} + +bool qemu_is_deprecated(ObjectClass *oc) +{ + return oc->supported.state =3D=3D SUPPORT_STATE_DEPRECATED; +} + +bool qemu_is_obsolete(ObjectClass *oc) +{ + return oc->supported.state =3D=3D SUPPORT_STATE_OBSOLETE; +} diff --git a/qapi/common.json b/qapi/common.json index 021174f04e..00374127b8 100644 --- a/qapi/common.json +++ b/qapi/common.json @@ -151,3 +151,35 @@ 'ppc64', 'riscv32', 'riscv64', 's390x', 'sh4', 'sh4eb', 'sparc', 'sparc64', 'tricore', 'unicore32', 'x86_64', 'xtensa', 'xtensaeb' ] } + +## +# @SupportState: +# +# Indicate Support level of qemu devices, backends, subsystems, ... +# +# @unspecified: not specified (zero-initialized). +# +# @experimental: in development, can be unstable or incomplete. +# +# @supported: works stable and is fully supported. +# (supported + maintained in MAINTAINERS). +# +# @unsupported: should work, support is weak or not present. +# (odd-fixes + orphan in MAINTAINERS). +# +# @obsolete: is obsolete, still present for compatibility reasons, +# will likely be removed at some point in the future. +# Not deprecated (yet). +# (obsolete in MAINTAINERS). +# +# @deprecated: is deprecated, according to qemu deprecation policy. +# +# Since: 3.2 +## +{ 'enum': 'SupportState', + 'data': [ 'unspecified', + 'experimental', + 'supported', + 'unsupported', + '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:20:12 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 From nobody Thu Nov 6 10:20:12 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 1541501170068174.9594567045193; Tue, 6 Nov 2018 02:46:10 -0800 (PST) Received: from localhost ([::1]:40172 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJys4-0007nq-Q9 for importer@patchew.org; Tue, 06 Nov 2018 05:46:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJykL-000699-PR 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-0005Gw-DS for qemu-devel@nongnu.org; Tue, 06 Nov 2018 05:23:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58394) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gJyWQ-0005GH-7Y; 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 2D29C30014DC; 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 9317C18241; Tue, 6 Nov 2018 10:23:36 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C18F88FAE; Tue, 6 Nov 2018 11:23:35 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 6 Nov 2018 11:23:33 +0100 Message-Id: <20181106102335.20027-5-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.45]); 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 4/6] Warn on obsolete and deprecated devices. 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" Print a warning for deprecated and obsolete devices. Also add support state to device listing. Signed-off-by: Gerd Hoffmann --- hw/core/qdev.c | 8 +++++++- qdev-monitor.c | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 6b3cc55b27..6205522c3e 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) { + ObjectClass *oc; DeviceState *dev; =20 - if (object_class_by_name(type) =3D=3D NULL) { + oc =3D object_class_by_name(type); + if (oc =3D=3D NULL) { return NULL; } + if (qemu_is_deprecated(oc) || + qemu_is_obsolete(oc)) { + qemu_warn_support_state("device", type, oc); + } dev =3D DEVICE(object_new(type)); if (!dev) { return NULL; diff --git a/qdev-monitor.c b/qdev-monitor.c index 802c18a74e..80370372f9 100644 --- a/qdev-monitor.c +++ b/qdev-monitor.c @@ -115,6 +115,8 @@ static void out_printf(const char *fmt, ...) =20 static void qdev_print_devinfo(DeviceClass *dc) { + ObjectClass *oc =3D OBJECT_CLASS(dc); + out_printf("name \"%s\"", object_class_get_name(OBJECT_CLASS(dc))); if (dc->bus_type) { out_printf(", bus %s", dc->bus_type); @@ -128,6 +130,9 @@ static void qdev_print_devinfo(DeviceClass *dc) if (!dc->user_creatable) { out_printf(", no-user"); } + if (oc->supported.state !=3D SUPPORT_STATE_UNSPECIFIED) { + out_printf(", %s", SupportState_str(oc->supported.state)); + } out_printf("\n"); } =20 @@ -579,6 +584,10 @@ DeviceState *qdev_device_add(QemuOpts *opts, Error **e= rrp) if (!dc) { return NULL; } + if (qemu_is_deprecated(OBJECT_CLASS(dc)) || + qemu_is_obsolete(OBJECT_CLASS(dc))) { + qemu_warn_support_state("device", driver, OBJECT_CLASS(dc)); + } =20 /* find bus */ path =3D qemu_opt_get(opts, "bus"); --=20 2.9.3 From nobody Thu Nov 6 10:20:12 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 1541501120981106.80530965954995; Tue, 6 Nov 2018 02:45:20 -0800 (PST) Received: from localhost ([::1]:40164 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJyrE-00077O-GU for importer@patchew.org; Tue, 06 Nov 2018 05:45:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39559) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJykL-0005qX-O0 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 1gJyWO-0005Ev-L9 for qemu-devel@nongnu.org; Tue, 06 Nov 2018 05:23:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:58334) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gJyWO-00052L-E7; Tue, 06 Nov 2018 05:23:44 -0500 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 93DF73082A36; Tue, 6 Nov 2018 10:23:38 +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 3FB92101F94C; Tue, 6 Nov 2018 10:23:38 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id CBCB78FAF; Tue, 6 Nov 2018 11:23:35 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 6 Nov 2018 11:23:34 +0100 Message-Id: <20181106102335.20027-6-kraxel@redhat.com> In-Reply-To: <20181106102335.20027-1-kraxel@redhat.com> References: <20181106102335.20027-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.45]); Tue, 06 Nov 2018 10:23:38 +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 5/6] 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 , =?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" Standard VGA should be used instead. Signed-off-by: Gerd Hoffmann --- 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..8474415687 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; + klass->supported.state =3D SUPPORT_STATE_OBSOLETE; + klass->supported.help =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..6bc83f7509 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); + klass->supported.state =3D SUPPORT_STATE_OBSOLETE; + klass->supported.help =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:20:12 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 1541501057658105.08791979029581; Tue, 6 Nov 2018 02:44:17 -0800 (PST) Received: from localhost ([::1]:40157 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJyqG-0006Ig-EX for importer@patchew.org; Tue, 06 Nov 2018 05:44:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJykL-0005Rx-Sf 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-0005H4-Gy for qemu-devel@nongnu.org; Tue, 06 Nov 2018 05:23:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:25068) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gJyWQ-0005GV-AJ; 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 4D8393086258; 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 3D1FC648A3; Tue, 6 Nov 2018 10:23:38 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id D48848FB0; Tue, 6 Nov 2018 11:23:35 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Tue, 6 Nov 2018 11:23:35 +0100 Message-Id: <20181106102335.20027-7-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.49]); 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 6/6] add UsageHints 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 , =?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" So we can add device usage recommendations to devices, independant from support state. Signed-off-by: Gerd Hoffmann --- include/qemu/support-state.h | 1 + qapi/common.json | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/include/qemu/support-state.h b/include/qemu/support-state.h index 6567d8702b..6ea0d03bd5 100644 --- a/include/qemu/support-state.h +++ b/include/qemu/support-state.h @@ -5,6 +5,7 @@ =20 typedef struct QemuSupportState { SupportState state; + UsageHints hints; const char *help; } QemuSupportState; =20 diff --git a/qapi/common.json b/qapi/common.json index 00374127b8..6952ea2074 100644 --- a/qapi/common.json +++ b/qapi/common.json @@ -183,3 +183,32 @@ 'unsupported', 'obsolete', 'deprecated' ] } + +## +# @UsageHints: +# +# Usage recommendations. +# +# @unspecified: not specified (zero-initialized). +# +# @green: Best choice. Typically paravirtual devices go into this +# category. +# Example (nic): virtio-net. +# Example (usb); xhci. +# +# @yellow: Reasonable choice. Typically emulated devices with +# good performance go into this category. +# Example (nic): e1000, e1000e +# +# @red: Bad choice. Avoid this unless you run an old guest which +# lacks support for something better. +# Example (nic): rtl8139, pcnet, ne2k, ... +# Example (usb): ehci, uhci, ohci +# +# Since: 3.2 +## +{ 'enum': 'UsageHints', + 'data': [ 'unspecified', + 'green', + 'yellow', + 'red' ] } --=20 2.9.3