]> git.proxmox.com Git - mirror_qemu.git/commit
qapi: Implement deprecated-input=reject for QMP commands
authorMarkus Armbruster <armbru@redhat.com>
Thu, 18 Mar 2021 15:55:17 +0000 (16:55 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Fri, 19 Mar 2021 15:05:11 +0000 (16:05 +0100)
commitd2032598c434fe385145ee6ea58007a19ef7e723
tree7e3d84fc72da52b789ecd41a7c7bd13ebb00d228
parent130d4824222cf062ed8ee3c5ab9fa2bd852b33b6
qapi: Implement deprecated-input=reject for QMP commands

This policy rejects deprecated input, and thus permits "testing the
future".  Implement it for QMP commands: make deprecated ones fail.
Example: when QEMU is run with -compat deprecated-input=reject, then

    {"execute": "query-cpus"}

fails like this

    {"error": {"class": "CommandNotFound", "desc": "Deprecated command query-cpus disabled by policy"}}

When the deprecated command is removed, the error will change to

    {"error": {"class": "CommandNotFound", "desc": "The command query-cpus has not been found"}}

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20210318155519.1224118-10-armbru@redhat.com>
include/qapi/qmp/dispatch.h
qapi/qmp-dispatch.c
scripts/qapi/commands.py
tests/unit/test-qmp-cmds.c