]> git.proxmox.com Git - mirror_qemu.git/commit - qapi/qapi-visit-core.c
qapi: Implement deprecated-input=reject for QMP command arguments
authorMarkus Armbruster <armbru@redhat.com>
Thu, 18 Mar 2021 15:55:18 +0000 (16:55 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Fri, 19 Mar 2021 15:05:11 +0000 (16:05 +0100)
commitdb29164103e53ae7c112086127e3d1c92b1d4d89
tree97d0238e1d19d87ee0ca9dbc09e3dd46a1a93eda
parentd2032598c434fe385145ee6ea58007a19ef7e723
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>
include/qapi/compat-policy.h
include/qapi/qobject-input-visitor.h
include/qapi/visitor-impl.h
include/qapi/visitor.h
qapi/qapi-visit-core.c
qapi/qmp-dispatch.c
qapi/qobject-input-visitor.c
qapi/trace-events
scripts/qapi/commands.py
scripts/qapi/visit.py
tests/unit/test-qmp-cmds.c