aboutsummaryrefslogtreecommitdiff
path: root/include/qapi/qobject-input-visitor.h
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-03-18 16:55:18 +0100
committerMarkus Armbruster <armbru@redhat.com>2021-03-19 16:05:11 +0100
commitdb29164103e53ae7c112086127e3d1c92b1d4d89 (patch)
tree97d0238e1d19d87ee0ca9dbc09e3dd46a1a93eda /include/qapi/qobject-input-visitor.h
parentd2032598c434fe385145ee6ea58007a19ef7e723 (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/qobject-input-visitor.h')
-rw-r--r--include/qapi/qobject-input-visitor.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/qapi/qobject-input-visitor.h b/include/qapi/qobject-input-visitor.h
index 95985e25e5..8d69388810 100644
--- a/include/qapi/qobject-input-visitor.h
+++ b/include/qapi/qobject-input-visitor.h
@@ -15,6 +15,7 @@
#ifndef QOBJECT_INPUT_VISITOR_H
#define QOBJECT_INPUT_VISITOR_H
+#include "qapi/qapi-types-compat.h"
#include "qapi/visitor.h"
typedef struct QObjectInputVisitor QObjectInputVisitor;
@@ -58,6 +59,9 @@ typedef struct QObjectInputVisitor QObjectInputVisitor;
*/
Visitor *qobject_input_visitor_new(QObject *obj);
+void qobject_input_visitor_set_policy(Visitor *v,
+ CompatPolicyInput deprecated);
+
/*
* Create a QObject input visitor for @obj for use with keyval_parse()
*