mirror of
https://github.com/mii443/qemu.git
synced 2025-12-07 21:18:22 +00:00
qapi: Move compat policy from QObject to generic visitor
The next commit needs to access compat policy from the generic visitor core. Move it there from qobject input and output visitor. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20211025042405.3762351-4-armbru@redhat.com>
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/compat-policy.h"
|
||||
#include "qapi/qobject-output-visitor.h"
|
||||
#include "qapi/visitor-impl.h"
|
||||
#include "qemu/queue.h"
|
||||
@@ -32,7 +31,6 @@ typedef struct QStackEntry {
|
||||
|
||||
struct QObjectOutputVisitor {
|
||||
Visitor visitor;
|
||||
CompatPolicyOutput deprecated_policy;
|
||||
|
||||
QSLIST_HEAD(, QStackEntry) stack; /* Stack of unfinished containers */
|
||||
QObject *root; /* Root of the output visit */
|
||||
@@ -212,9 +210,7 @@ static bool qobject_output_type_null(Visitor *v, const char *name,
|
||||
|
||||
static bool qobject_output_deprecated(Visitor *v, const char *name)
|
||||
{
|
||||
QObjectOutputVisitor *qov = to_qov(v);
|
||||
|
||||
return qov->deprecated_policy != COMPAT_POLICY_OUTPUT_HIDE;
|
||||
return v->compat_policy.deprecated_output != COMPAT_POLICY_OUTPUT_HIDE;
|
||||
}
|
||||
|
||||
/* Finish building, and return the root object.
|
||||
@@ -275,11 +271,3 @@ Visitor *qobject_output_visitor_new(QObject **result)
|
||||
|
||||
return &v->visitor;
|
||||
}
|
||||
|
||||
void qobject_output_visitor_set_policy(Visitor *v,
|
||||
CompatPolicyOutput deprecated)
|
||||
{
|
||||
QObjectOutputVisitor *qov = to_qov(v);
|
||||
|
||||
qov->deprecated_policy = deprecated;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user