From db29164103e53ae7c112086127e3d1c92b1d4d89 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Thu, 18 Mar 2021 16:55:18 +0100 Subject: qapi: Implement deprecated-input=reject for QMP command arguments This policy rejects deprecated input, and thus permits "testing the future". Implement it for QMP command arguments: reject commands with deprecated ones. Example: when QEMU is run with -compat deprecated-input=reject, then {"execute": "eject", "arguments": {"device": "cd"}} fails like this {"error": {"class": "GenericError", "desc": "Deprecated parameter 'device' disabled by policy"}} When the deprecated parameter is removed, the error will change to {"error": {"class": "GenericError", "desc": "Parameter 'device' is unexpected"}} Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Message-Id: <20210318155519.1224118-11-armbru@redhat.com> --- scripts/qapi/commands.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts/qapi/commands.py') diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py index c462851..0e13d51 100644 --- a/scripts/qapi/commands.py +++ b/scripts/qapi/commands.py @@ -154,7 +154,7 @@ def gen_marshal(name: str, ret += mcgen(''' - v = qobject_input_visitor_new(QOBJECT(args)); + v = qobject_input_visitor_new_qmp(QOBJECT(args)); if (!visit_start_struct(v, NULL, NULL, 0, errp)) { goto out; } @@ -258,7 +258,6 @@ class QAPISchemaGenCommandVisitor(QAPISchemaModularCVisitor): #include "qapi/compat-policy.h" #include "qapi/visitor.h" #include "qapi/qmp/qdict.h" -#include "qapi/qobject-input-visitor.h" #include "qapi/dealloc-visitor.h" #include "qapi/error.h" #include "%(visit)s.h" -- cgit v1.1