mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
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>
This commit is contained in:
parent
d2032598c4
commit
db29164103
11 changed files with 101 additions and 2 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue