aboutsummaryrefslogtreecommitdiff
path: root/softmmu
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 /softmmu
parentb1eee9bb6de5902a8eabff4a9e7556855fadea6c (diff)
downloadqemu-6dd75472d58d3d199eb5003a8d2ec2334c68f18f.zip
qemu-6dd75472d58d3d199eb5003a8d2ec2334c68f18f.tar.gz
qemu-6dd75472d58d3d199eb5003a8d2ec2334c68f18f.tar.bz2
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 'softmmu')
-rw-r--r--softmmu/vl.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/softmmu/vl.c b/softmmu/vl.c
index cba7ab3..4cbbdd8 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -29,6 +29,7 @@
#include "exec/cpu-common.h"
#include "hw/boards.h"
#include "hw/qdev-properties.h"
+#include "qapi/compat-policy.h"
#include "qapi/error.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qmp/qjson.h"
@@ -114,6 +115,7 @@
#include "sysemu/replay.h"
#include "qapi/qapi-events-run-state.h"
#include "qapi/qapi-visit-block-core.h"
+#include "qapi/qapi-visit-compat.h"
#include "qapi/qapi-visit-ui.h"
#include "qapi/qapi-commands-block-core.h"
#include "qapi/qapi-commands-migration.h"
@@ -3458,6 +3460,21 @@ void qemu_init(int argc, char **argv, char **envp)
enable_mlock = qemu_opt_get_bool(opts, "mem-lock", false);
enable_cpu_pm = qemu_opt_get_bool(opts, "cpu-pm", false);
break;
+ case QEMU_OPTION_compat:
+ {
+ CompatPolicy *opts;
+ Visitor *v;
+
+ v = qobject_input_visitor_new_str(optarg, NULL,
+ &error_fatal);
+
+ visit_type_CompatPolicy(v, NULL, &opts, &error_fatal);
+ QAPI_CLONE_MEMBERS(CompatPolicy, &compat_policy, opts);
+
+ qapi_free_CompatPolicy(opts);
+ visit_free(v);
+ break;
+ }
case QEMU_OPTION_msg:
opts = qemu_opts_parse_noisily(qemu_find_opts("msg"), optarg,
false);