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>
Showing
- include/qapi/compat-policy.h 9 additions, 0 deletionsinclude/qapi/compat-policy.h
- include/qapi/qobject-input-visitor.h 4 additions, 0 deletionsinclude/qapi/qobject-input-visitor.h
- include/qapi/visitor-impl.h 3 additions, 0 deletionsinclude/qapi/visitor-impl.h
- include/qapi/visitor.h 9 additions, 0 deletionsinclude/qapi/visitor.h
- qapi/qapi-visit-core.c 9 additions, 0 deletionsqapi/qapi-visit-core.c
- qapi/qmp-dispatch.c 9 additions, 0 deletionsqapi/qmp-dispatch.c
- qapi/qobject-input-visitor.c 28 additions, 0 deletionsqapi/qobject-input-visitor.c
- qapi/trace-events 1 addition, 0 deletionsqapi/trace-events
- scripts/qapi/commands.py 1 addition, 2 deletionsscripts/qapi/commands.py
- scripts/qapi/visit.py 3 additions, 0 deletionsscripts/qapi/visit.py
- tests/unit/test-qmp-cmds.c 25 additions, 0 deletionstests/unit/test-qmp-cmds.c
Loading
Please register or sign in to comment