summaryrefslogtreecommitdiff
path: root/qapi/qmp-output-visitor.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-09-16 13:06:24 +0200
committerMarkus Armbruster <armbru@redhat.com>2015-09-21 09:56:49 +0200
commit28770e057f265a4e70bcbdfc2447cce7b5f2dc19 (patch)
treee0da3cb258bdbb19e46ab4868cd887dd064ee3db /qapi/qmp-output-visitor.c
parent6c2f9a15dfc8c18ba94defb0f819109902a817cb (diff)
downloadqemu-28770e057f265a4e70bcbdfc2447cce7b5f2dc19.zip
qapi: Introduce a first class 'any' type
It's first class, because unlike '**', it actually works, i.e. doesn't require 'gen': false. '**' will go away next. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'qapi/qmp-output-visitor.c')
-rw-r--r--qapi/qmp-output-visitor.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/qapi/qmp-output-visitor.c b/qapi/qmp-output-visitor.c
index 8dce08749d..29899acd46 100644
--- a/qapi/qmp-output-visitor.c
+++ b/qapi/qmp-output-visitor.c
@@ -190,6 +190,14 @@ static void qmp_output_type_number(Visitor *v, double *obj, const char *name,
qmp_output_add(qov, name, qfloat_from_double(*obj));
}
+static void qmp_output_type_any(Visitor *v, QObject **obj, const char *name,
+ Error **errp)
+{
+ QmpOutputVisitor *qov = to_qov(v);
+ qobject_incref(*obj);
+ qmp_output_add_obj(qov, name, *obj);
+}
+
QObject *qmp_output_get_qobject(QmpOutputVisitor *qov)
{
QObject *obj = qmp_output_first(qov);
@@ -237,6 +245,7 @@ QmpOutputVisitor *qmp_output_visitor_new(void)
v->visitor.type_bool = qmp_output_type_bool;
v->visitor.type_str = qmp_output_type_str;
v->visitor.type_number = qmp_output_type_number;
+ v->visitor.type_any = qmp_output_type_any;
QTAILQ_INIT(&v->stack);