aboutsummaryrefslogtreecommitdiff
path: root/qapi/qmp-dispatch.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-03-18 16:55:10 +0100
committerMarkus Armbruster <armbru@redhat.com>2021-03-19 15:43:33 +0100
commit6dd75472d58d3d199eb5003a8d2ec2334c68f18f (patch)
treee3b749508b50981561e7c9e647504db605d8a4ec /qapi/qmp-dispatch.c
parentb1eee9bb6de5902a8eabff4a9e7556855fadea6c (diff)
qemu-options: New -compat to set policy for deprecated interfaces
New option -compat lets you configure what to do when deprecated interfaces get used. This is intended for testing users of the management interfaces. It is experimental. -compat deprecated-input=<input-policy> configures what to do when deprecated input is received. Input policy can be "accept" (accept silently), or "reject" (reject the request with an error). -compat deprecated-output=<out-policy> configures what to do when deprecated output is sent. Output policy can be "accept" (pass on unchanged), or "hide" (filter out the deprecated parts). Default is "accept". Policies other than "accept" are implemented later in this series. For now, -compat covers only syntactic aspects of QMP, i.e. stuff tagged with feature 'deprecated'. We may want to extend it to cover semantic aspects, CLI, and experimental features. Note that there is no good way for management application to detect presence of -compat: it's not visible output of query-qmp-schema or query-command-line-options. Tolerable, because it's meant for testing. If running with -compat fails, skip the test. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20210318155519.1224118-3-armbru@redhat.com>
Diffstat (limited to 'qapi/qmp-dispatch.c')
-rw-r--r--qapi/qmp-dispatch.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/qapi/qmp-dispatch.c b/qapi/qmp-dispatch.c
index 5e597c76f7..f6a65f502d 100644
--- a/qapi/qmp-dispatch.c
+++ b/qapi/qmp-dispatch.c
@@ -14,6 +14,7 @@
#include "qemu/osdep.h"
#include "block/aio.h"
+#include "qapi/compat-policy.h"
#include "qapi/error.h"
#include "qapi/qmp/dispatch.h"
#include "qapi/qmp/qdict.h"
@@ -23,6 +24,8 @@
#include "qemu/coroutine.h"
#include "qemu/main-loop.h"
+CompatPolicy compat_policy;
+
static QDict *qmp_dispatch_check_obj(QDict *dict, bool allow_oob,
Error **errp)
{