diff options
author | Markus Armbruster <armbru@redhat.com> | 2021-03-18 16:55:18 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2021-03-19 16:05:11 +0100 |
commit | db29164103e53ae7c112086127e3d1c92b1d4d89 (patch) | |
tree | 97d0238e1d19d87ee0ca9dbc09e3dd46a1a93eda /include/qapi/compat-policy.h | |
parent | d2032598c434fe385145ee6ea58007a19ef7e723 (diff) |
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 <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20210318155519.1224118-11-armbru@redhat.com>
Diffstat (limited to 'include/qapi/compat-policy.h')
-rw-r--r-- | include/qapi/compat-policy.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/qapi/compat-policy.h b/include/qapi/compat-policy.h index 94c8bbd790..1083f95122 100644 --- a/include/qapi/compat-policy.h +++ b/include/qapi/compat-policy.h @@ -18,6 +18,15 @@ extern CompatPolicy compat_policy; /* + * Create a QObject input visitor for @obj for use with QMP + * + * This is like qobject_input_visitor_new(), except it obeys the + * policy for handling deprecated management interfaces set with + * -compat. + */ +Visitor *qobject_input_visitor_new_qmp(QObject *obj); + +/* * Create a QObject output visitor for @obj for use with QMP * * This is like qobject_output_visitor_new(), except it obeys the |