From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8BD4AC433EF for ; Mon, 25 Oct 2021 19:49:50 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F2C6C60551 for ; Mon, 25 Oct 2021 19:49:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F2C6C60551 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:42958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mf5ye-0008Ty-VI for qemu-devel@archiver.kernel.org; Mon, 25 Oct 2021 15:49:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47536) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mf5pg-0007Q7-GN for qemu-devel@nongnu.org; Mon, 25 Oct 2021 15:40:35 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:38129) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mf5pX-0003de-9b for qemu-devel@nongnu.org; Mon, 25 Oct 2021 15:40:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1635190821; 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: in-reply-to:in-reply-to:references:references; bh=gdqIirO7/6TIFeEs37qaZf8eLvshsT6tfXjHk5koOsA=; b=jREVeDUj2vjSvG/OJiPHeTFMKOmQDSJtpZcgjegaqXQguTa9Hu9cyK/5UHu59DXFxZZWBk O/GLxZ3PbIvYSwClFgmyRbQXfDdXU+fZn10qnKqfNwFeC+DDST9mJdzAIlo12p20d2E0m3 FZj9oc5+cjgyiU31BkuBS1rcyz5XB5U= Received: from mail-vk1-f200.google.com (mail-vk1-f200.google.com [209.85.221.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-304--uEPLXEnM2ynqZKopSpSlg-1; Mon, 25 Oct 2021 15:40:18 -0400 X-MC-Unique: -uEPLXEnM2ynqZKopSpSlg-1 Received: by mail-vk1-f200.google.com with SMTP id x16-20020a1f3110000000b002a40c805e53so3720563vkx.7 for ; Mon, 25 Oct 2021 12:40:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gdqIirO7/6TIFeEs37qaZf8eLvshsT6tfXjHk5koOsA=; b=L4bmO1s6WywjRrPYMwdqeN9sGb7246s1DI/yeQS4V5KzNGIVqx3EsWlLmZO28J5BU9 dBxOODQ1kuIoz5QgW2yZ3vrCZVqJLthYas02cyBfb9uzRQtGakFjm1EKlP8Ee7+xmdi7 HHaV+dI7avTQ53doYsemS4NzA3No/ejXo0AIKQ0BlRK544KIvzj5MeFgwduq5jmtVW9a uuELVFz3PX+mZjGKbfwBbVoWIAprsNfVCGS2h6TOKtZcD7frgb/t0ccwrZSznVyjgrnT rEjcDMDtQCa+awqTfxd3eTST5Ub2INDuY7v7aT7G/SRYCrKLOq5jHQpNoNKyAwbCmOjl 4BKA== X-Gm-Message-State: AOAM5311YUYmtZhBdqJX2rhMAL4HyPcc5n6fYCrFwAl54qex0lY28K28 2Jt40r46cEgKh177CsHWyphfqXJv/K/vGA3qzLUv2Md2R73fYJ+YdS5OLx6CJ8R1EyTPvs0PmUe hrGPhQYhLbi92IBGFRJSt1fscUmFf7wo= X-Received: by 2002:a05:6122:2214:: with SMTP id bb20mr17225245vkb.9.1635190817915; Mon, 25 Oct 2021 12:40:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6dukVC+DTTKzCUAzk73WTow5e09w9u/f2Y/kDedw4gBn9qH6cJY8XnTS03S5MnLiVpIz0xJJQotd8XTZe/34= X-Received: by 2002:a05:6122:2214:: with SMTP id bb20mr17225203vkb.9.1635190817693; Mon, 25 Oct 2021 12:40:17 -0700 (PDT) MIME-Version: 1.0 References: <20211025052532.3859634-1-armbru@redhat.com> <20211025052532.3859634-10-armbru@redhat.com> In-Reply-To: <20211025052532.3859634-10-armbru@redhat.com> From: John Snow Date: Mon, 25 Oct 2021 15:40:07 -0400 Message-ID: Subject: Re: [PATCH 9/9] qapi: Extend -compat to set policy for unstable interfaces To: Markus Armbruster Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=jsnow@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="000000000000d438a305cf3287b0" Received-SPF: pass client-ip=170.10.133.124; envelope-from=jsnow@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , pkrempa@redhat.com, Daniel Berrange , Eduardo Habkost , qemu-block@nongnu.org, Juan Quintela , libvir-list@redhat.com, qemu-devel , mdroth@linux.vnet.ibm.com, "Dr. David Alan Gilbert" , Paolo Bonzini , =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= , Eric Blake , libguestfs@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --000000000000d438a305cf3287b0 Content-Type: text/plain; charset="UTF-8" On Mon, Oct 25, 2021 at 1:26 AM Markus Armbruster wrote: > New option parameters unstable-input and unstable-output set policy > for unstable interfaces just like deprecated-input and > deprecated-output set policy for deprecated interfaces (see commit > 6dd75472d5 "qemu-options: New -compat to set policy for deprecated > interfaces"). This is intended for testing users of the management > interfaces. It is experimental. > > For now, this covers only syntactic aspects of QMP, i.e. stuff tagged > with feature 'unstable'. We may want to extend it to cover semantic > aspects, or the command line. > > Note that there is no good way for management application to detect > presence of these new option parameters: they are not visible output > of query-qmp-schema or query-command-line-options. Tolerable, because > it's meant for testing. If running with -compat fails, skip the test. > > Signed-off-by: Markus Armbruster > --- > qapi/compat.json | 6 +++++- > include/qapi/util.h | 1 + > qapi/qmp-dispatch.c | 6 ++++++ > qapi/qobject-output-visitor.c | 8 ++++++-- > qemu-options.hx | 20 +++++++++++++++++++- > scripts/qapi/events.py | 10 ++++++---- > scripts/qapi/schema.py | 10 ++++++---- > 7 files changed, 49 insertions(+), 12 deletions(-) > > diff --git a/qapi/compat.json b/qapi/compat.json > index 74a8493d3d..9bc9804abb 100644 > --- a/qapi/compat.json > +++ b/qapi/compat.json > @@ -47,9 +47,13 @@ > # > # @deprecated-input: how to handle deprecated input (default 'accept') > # @deprecated-output: how to handle deprecated output (default 'accept') > +# @unstable-input: how to handle unstable input (default 'accept') > +# @unstable-output: how to handle unstable output (default 'accept') > # > # Since: 6.0 > ## > { 'struct': 'CompatPolicy', > 'data': { '*deprecated-input': 'CompatPolicyInput', > - '*deprecated-output': 'CompatPolicyOutput' } } > + '*deprecated-output': 'CompatPolicyOutput', > + '*unstable-input': 'CompatPolicyInput', > + '*unstable-output': 'CompatPolicyOutput' } } > diff --git a/include/qapi/util.h b/include/qapi/util.h > index 0cc98db9f9..81a2b13a33 100644 > --- a/include/qapi/util.h > +++ b/include/qapi/util.h > @@ -13,6 +13,7 @@ > > typedef enum { > QAPI_DEPRECATED, > + QAPI_UNSTABLE, > } QapiSpecialFeature; > > typedef struct QEnumLookup { > diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c > index e29ade134c..c5c6e521a2 100644 > --- a/qapi/qmp-dispatch.c > +++ b/qapi/qmp-dispatch.c > @@ -59,6 +59,12 @@ bool compat_policy_input_ok(unsigned special_features, > error_class, kind, name, errp)) { > return false; > } > + if ((special_features & (1u << QAPI_UNSTABLE)) > + && !compat_policy_input_ok1("Unstable", > + policy->unstable_input, > + error_class, kind, name, errp)) { > + return false; > + } > return true; > } > > diff --git a/qapi/qobject-output-visitor.c b/qapi/qobject-output-visitor.c > index b5c6564cbb..74770edd73 100644 > --- a/qapi/qobject-output-visitor.c > +++ b/qapi/qobject-output-visitor.c > @@ -212,8 +212,12 @@ static bool qobject_output_type_null(Visitor *v, > const char *name, > static bool qobject_output_policy_skip(Visitor *v, const char *name, > unsigned special_features) > { > - return !(special_features && 1u << QAPI_DEPRECATED) > - || v->compat_policy.deprecated_output == > COMPAT_POLICY_OUTPUT_HIDE; > + CompatPolicy *pol = &v->compat_policy; > + > + return ((special_features & 1u << QAPI_DEPRECATED) > + && pol->deprecated_output == COMPAT_POLICY_OUTPUT_HIDE) > + || ((special_features & 1u << QAPI_UNSTABLE) > + && pol->unstable_output == COMPAT_POLICY_OUTPUT_HIDE); > } > > /* Finish building, and return the root object. > diff --git a/qemu-options.hx b/qemu-options.hx > index 5f375bbfa6..f051536b63 100644 > --- a/qemu-options.hx > +++ b/qemu-options.hx > @@ -3641,7 +3641,9 @@ DEFHEADING(Debug/Expert options:) > > DEF("compat", HAS_ARG, QEMU_OPTION_compat, > "-compat > [deprecated-input=accept|reject|crash][,deprecated-output=accept|hide]\n" > - " Policy for handling deprecated management > interfaces\n", > + " Policy for handling deprecated management > interfaces\n" > + "-compat > [unstable-input=accept|reject|crash][,unstable-output=accept|hide]\n" > + " Policy for handling unstable management > interfaces\n", > QEMU_ARCH_ALL) > SRST > ``-compat > [deprecated-input=@var{input-policy}][,deprecated-output=@var{output-policy}]`` > @@ -3659,6 +3661,22 @@ SRST > Suppress deprecated command results and events > > Limitation: covers only syntactic aspects of QMP. > + > +``-compat > [unstable-input=@var{input-policy}][,unstable-output=@var{output-policy}]`` > + Set policy for handling unstable management interfaces (experimental): > + > + ``unstable-input=accept`` (default) > + Accept unstable commands and arguments > + ``unstable-input=reject`` > + Reject unstable commands and arguments > + ``unstable-input=crash`` > + Crash on unstable commands and arguments > + ``unstable-output=accept`` (default) > + Emit unstable command results and events > + ``unstable-output=hide`` > + Suppress unstable command results and events > + > + Limitation: covers only syntactic aspects of QMP. > ERST > > DEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg, > diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py > index 82475e84ec..27b44c49f5 100644 > --- a/scripts/qapi/events.py > +++ b/scripts/qapi/events.py > @@ -109,13 +109,15 @@ def gen_event_send(name: str, > if not boxed: > ret += gen_param_var(arg_type) > > - if 'deprecated' in [f.name for f in features]: > - ret += mcgen(''' > + for f in features: > + if f.is_special(): > + ret += mcgen(''' > > - if (compat_policy.deprecated_output == COMPAT_POLICY_OUTPUT_HIDE) { > + if (compat_policy.%(feat)s_output == COMPAT_POLICY_OUTPUT_HIDE) { > return; > } > -''') > +''', > + feat=f.name) > > ret += mcgen(''' > > diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py > index 55f82d7389..b7b3fc0ce4 100644 > --- a/scripts/qapi/schema.py > +++ b/scripts/qapi/schema.py > @@ -254,9 +254,11 @@ def doc_type(self): > > def check(self, schema): > QAPISchemaEntity.check(self, schema) > - if 'deprecated' in [f.name for f in self.features]: > - raise QAPISemError( > - self.info, "feature 'deprecated' is not supported for > types") > + for feat in self.features: > + if feat.is_special(): > + raise QAPISemError( > + self.info, > + f"feature '{feat.name}' is not supported for types") > > def describe(self): > assert self.meta > @@ -726,7 +728,7 @@ class QAPISchemaFeature(QAPISchemaMember): > role = 'feature' > > def is_special(self): > - return self.name in ('deprecated') > + return self.name in ('deprecated', 'unstable') > > > class QAPISchemaObjectTypeMember(QAPISchemaMember): > -- > 2.31.1 > > Python bits: Acked-by: John Snow Looks good overall from what I can see, minor style quibbles that I'd probably fold on if you frowned at me. --js --000000000000d438a305cf3287b0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Oct 25, 2021 at 1:26 AM Marku= s Armbruster <armbru@redhat.com= > wrote:
New = option parameters unstable-input and unstable-output set policy
for unstable interfaces just like deprecated-input and
deprecated-output set policy for deprecated interfaces (see commit
6dd75472d5 "qemu-options: New -compat to set policy for deprecated
interfaces").=C2=A0 This is intended for testing users of the manageme= nt
interfaces.=C2=A0 It is experimental.

For now, this covers only syntactic aspects of QMP, i.e. stuff tagged
with feature 'unstable'.=C2=A0 We may want to extend it to cover se= mantic
aspects, or the command line.

Note that there is no good way for management application to detect
presence of these new option parameters: they are not visible output
of query-qmp-schema or query-command-line-options.=C2=A0 Tolerable, because=
it's meant for testing.=C2=A0 If running with -compat fails, skip the t= est.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
=C2=A0qapi/compat.json=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2= =A0 6 +++++-
=C2=A0include/qapi/util.h=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 1= +
=C2=A0qapi/qmp-dispatch.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0|=C2=A0 6= ++++++
=C2=A0qapi/qobject-output-visitor.c |=C2=A0 8 ++++++--
=C2=A0qemu-options.hx=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0| 20 +++++++++++++++++++-
=C2=A0scripts/qapi/events.py=C2=A0 =C2=A0 =C2=A0 =C2=A0 | 10 ++++++----
=C2=A0scripts/qapi/schema.py=C2=A0 =C2=A0 =C2=A0 =C2=A0 | 10 ++++++----
=C2=A07 files changed, 49 insertions(+), 12 deletions(-)

diff --git a/qapi/compat.json b/qapi/compat.json
index 74a8493d3d..9bc9804abb 100644
--- a/qapi/compat.json
+++ b/qapi/compat.json
@@ -47,9 +47,13 @@
=C2=A0#
=C2=A0# @deprecated-input: how to handle deprecated input (default 'acc= ept')
=C2=A0# @deprecated-output: how to handle deprecated output (default 'a= ccept')
+# @unstable-input: how to handle unstable input (default 'accept')=
+# @unstable-output: how to handle unstable output (default 'accept'= ;)
=C2=A0#
=C2=A0# Since: 6.0
=C2=A0##
=C2=A0{ 'struct': 'CompatPolicy',
=C2=A0 =C2=A0'data': { '*deprecated-input': 'CompatPoli= cyInput',
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 '*deprecated-output': &#= 39;CompatPolicyOutput' } }
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 '*deprecated-output': &#= 39;CompatPolicyOutput',
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 '*unstable-input': '= CompatPolicyInput',
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 '*unstable-output': '= ;CompatPolicyOutput' } }
diff --git a/include/qapi/util.h b/include/qapi/util.h
index 0cc98db9f9..81a2b13a33 100644
--- a/include/qapi/util.h
+++ b/include/qapi/util.h
@@ -13,6 +13,7 @@

=C2=A0typedef enum {
=C2=A0 =C2=A0 =C2=A0QAPI_DEPRECATED,
+=C2=A0 =C2=A0 QAPI_UNSTABLE,
=C2=A0} QapiSpecialFeature;

=C2=A0typedef struct QEnumLookup {
diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c
index e29ade134c..c5c6e521a2 100644
--- a/qapi/qmp-dispatch.c
+++ b/qapi/qmp-dispatch.c
@@ -59,6 +59,12 @@ bool compat_policy_input_ok(unsigned special_features, =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0error_class, kin= d, name, errp)) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return false;
=C2=A0 =C2=A0 =C2=A0}
+=C2=A0 =C2=A0 if ((special_features & (1u << QAPI_UNSTABLE))
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 && !compat_policy_input_ok1("Unst= able",
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 policy->unstable_in= put,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 error_class, kind, nam= e, errp)) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 return false;
+=C2=A0 =C2=A0 }
=C2=A0 =C2=A0 =C2=A0return true;
=C2=A0}

diff --git a/qapi/qobject-output-visitor.c b/qapi/qobject-output-visitor.c<= br> index b5c6564cbb..74770edd73 100644
--- a/qapi/qobject-output-visitor.c
+++ b/qapi/qobject-output-visitor.c
@@ -212,8 +212,12 @@ static bool qobject_output_type_null(Visitor *v, const= char *name,
=C2=A0static bool qobject_output_policy_skip(Visitor *v, const char *name,<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 unsigned= special_features)
=C2=A0{
-=C2=A0 =C2=A0 return !(special_features && 1u << QAPI_DEPREC= ATED)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 || v->compat_policy.deprecated_output =3D= =3D COMPAT_POLICY_OUTPUT_HIDE;
+=C2=A0 =C2=A0 CompatPolicy *pol =3D &v->compat_policy;
+
+=C2=A0 =C2=A0 return ((special_features & 1u << QAPI_DEPRECATED)=
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 && pol->deprecated_ou= tput =3D=3D COMPAT_POLICY_OUTPUT_HIDE)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 || ((special_features & 1u << QAPI_U= NSTABLE)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 && pol->unstable_outp= ut =3D=3D COMPAT_POLICY_OUTPUT_HIDE);
=C2=A0}

=C2=A0/* Finish building, and return the root object.
diff --git a/qemu-options.hx b/qemu-options.hx
index 5f375bbfa6..f051536b63 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -3641,7 +3641,9 @@ DEFHEADING(Debug/Expert options:)

=C2=A0DEF("compat", HAS_ARG, QEMU_OPTION_compat,
=C2=A0 =C2=A0 =C2=A0"-compat [deprecated-input=3Daccept|reject|crash][= ,deprecated-output=3Daccept|hide]\n"
-=C2=A0 =C2=A0 "=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 Policy for handling deprecated management interfaces\n",
+=C2=A0 =C2=A0 "=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 Policy for handling deprecated management interfaces\n"
+=C2=A0 =C2=A0 "-compat [unstable-input=3Daccept|reject|crash][,unstab= le-output=3Daccept|hide]\n"
+=C2=A0 =C2=A0 "=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 Policy for handling unstable management interfaces\n",
=C2=A0 =C2=A0 =C2=A0QEMU_ARCH_ALL)
=C2=A0SRST
=C2=A0``-compat [deprecated-input=3D@var{input-policy}][,deprecated-output= =3D@var{output-policy}]``
@@ -3659,6 +3661,22 @@ SRST
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Suppress deprecated command results and e= vents

=C2=A0 =C2=A0 =C2=A0Limitation: covers only syntactic aspects of QMP.
+
+``-compat [unstable-input=3D@var{input-policy}][,unstable-output=3D@var{ou= tput-policy}]``
+=C2=A0 =C2=A0 Set policy for handling unstable management interfaces (expe= rimental):
+
+=C2=A0 =C2=A0 ``unstable-input=3Daccept`` (default)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Accept unstable commands and arguments
+=C2=A0 =C2=A0 ``unstable-input=3Dreject``
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Reject unstable commands and arguments
+=C2=A0 =C2=A0 ``unstable-input=3Dcrash``
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Crash on unstable commands and arguments
+=C2=A0 =C2=A0 ``unstable-output=3Daccept`` (default)
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Emit unstable command results and events
+=C2=A0 =C2=A0 ``unstable-output=3Dhide``
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 Suppress unstable command results and events +
+=C2=A0 =C2=A0 Limitation: covers only syntactic aspects of QMP.
=C2=A0ERST

=C2=A0DEF("fw_cfg", HAS_ARG, QEMU_OPTION_fwcfg,
diff --git a/scripts/qapi/events.py b/scripts/qapi/events.py
index 82475e84ec..27b44c49f5 100644
--- a/scripts/qapi/events.py
+++ b/scripts/qapi/events.py
@@ -109,13 +109,15 @@ def gen_event_send(name: str,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if not boxed:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ret +=3D gen_param_var(arg_= type)

-=C2=A0 =C2=A0 if 'deprecated' in [f.name for f in features]:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 ret +=3D mcgen('''
+=C2=A0 =C2=A0 for f in features:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 if f.is_special():
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ret +=3D mcgen('''
-=C2=A0 =C2=A0 if (compat_policy.deprecated_output =3D=3D COMPAT_POLICY_OUT= PUT_HIDE) {
+=C2=A0 =C2=A0 if (compat_policy.%(feat)s_output =3D=3D COMPAT_POLICY_OUTPU= T_HIDE) {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return;
=C2=A0 =C2=A0 =C2=A0}
-''')
+''',
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0feat=3Df.name)

=C2=A0 =C2=A0 =C2=A0ret +=3D mcgen('''

diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 55f82d7389..b7b3fc0ce4 100644
--- a/scripts/qapi/schema.py
+++ b/scripts/qapi/schema.py
@@ -254,9 +254,11 @@ def doc_type(self):

=C2=A0 =C2=A0 =C2=A0def check(self, schema):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0QAPISchemaEntity.check(self, schema)
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 if 'deprecated' in [f.name for f in self.featu= res]:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 raise QAPISemError(
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.info, "featur= e 'deprecated' is not supported for types")
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 for feat in self.features:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if feat.is_special():
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 raise QAPISemError= (
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 self.info= ,
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 f&qu= ot;feature '{feat.name}' is not supported for types")

=C2=A0 =C2=A0 =C2=A0def describe(self):
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0assert self.meta
@@ -726,7 +728,7 @@ class QAPISchemaFeature(QAPISchemaMember):
=C2=A0 =C2=A0 =C2=A0role =3D 'feature'

=C2=A0 =C2=A0 =C2=A0def is_special(self):
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 return self.name in ('deprecated')
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 return self.name in ('deprecated', 'uns= table')


=C2=A0class QAPISchemaObjectTypeMember(QAPISchemaMember):
--
2.31.1


Python bits: Acked-by: John Snow <<= a href=3D"mailto:jsnow@redhat.com">jsnow@redhat.com>

<= /div>
Looks good overall from what I can see, minor style quibbles that= I'd probably fold on if you frowned at me.

--= js
--000000000000d438a305cf3287b0--