2021-03-18 16:55:10 +01:00
|
|
|
/*
|
|
|
|
* Policy for handling "funny" management interfaces
|
|
|
|
*
|
|
|
|
* Copyright (C) 2020 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Markus Armbruster <armbru@redhat.com>
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or
|
|
|
|
* later. See the COPYING file in the top-level directory.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QAPI_COMPAT_POLICY_H
|
|
|
|
#define QAPI_COMPAT_POLICY_H
|
|
|
|
|
|
|
|
#include "qapi/qapi-types-compat.h"
|
|
|
|
|
|
|
|
extern CompatPolicy compat_policy;
|
|
|
|
|
2021-03-18 16:55:18 +01:00
|
|
|
/*
|
|
|
|
* Create a QObject input visitor for @obj for use with QMP
|
|
|
|
*
|
|
|
|
* This is like qobject_input_visitor_new(), except it obeys the
|
|
|
|
* policy for handling deprecated management interfaces set with
|
|
|
|
* -compat.
|
|
|
|
*/
|
|
|
|
Visitor *qobject_input_visitor_new_qmp(QObject *obj);
|
|
|
|
|
qapi: Implement deprecated-output=hide for QMP command results
This policy suppresses deprecated bits in output, and thus permits
"testing the future". Implement it for QMP command results. Example:
when QEMU is run with -compat deprecated-output=hide, then
{"execute": "query-cpus-fast"}
yields
{"return": [{"thread-id": 9805, "props": {"core-id": 0, "thread-id": 0, "socket-id": 0}, "qom-path": "/machine/unattached/device[0]", "cpu-index": 0, "target": "x86_64"}]}
instead of
{"return": [{"arch": "x86", "thread-id": 22436, "props": {"core-id": 0, "thread-id": 0, "socket-id": 0}, "qom-path": "/machine/unattached/device[0]", "cpu-index": 0, "target": "x86_64"}]}
Note the suppression of deprecated member "arch".
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20210318155519.1224118-4-armbru@redhat.com>
2021-03-18 16:55:11 +01:00
|
|
|
/*
|
|
|
|
* Create a QObject output visitor for @obj for use with QMP
|
|
|
|
*
|
|
|
|
* This is like qobject_output_visitor_new(), except it obeys the
|
|
|
|
* policy for handling deprecated management interfaces set with
|
|
|
|
* -compat.
|
|
|
|
*/
|
|
|
|
Visitor *qobject_output_visitor_new_qmp(QObject **result);
|
|
|
|
|
2021-03-18 16:55:10 +01:00
|
|
|
#endif
|