aboutsummaryrefslogtreecommitdiff
path: root/qapi/qapi-dealloc-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/qapi-dealloc-visitor.c
parent6c2f9a15dfc8c18ba94defb0f819109902a817cb (diff)
downloadqemu-28770e057f265a4e70bcbdfc2447cce7b5f2dc19.zip
qemu-28770e057f265a4e70bcbdfc2447cce7b5f2dc19.tar.gz
qemu-28770e057f265a4e70bcbdfc2447cce7b5f2dc19.tar.bz2
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/qapi-dealloc-visitor.c')
-rw-r--r--qapi/qapi-dealloc-visitor.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/qapi/qapi-dealloc-visitor.c b/qapi/qapi-dealloc-visitor.c
index d7f92c5..737deab 100644
--- a/qapi/qapi-dealloc-visitor.c
+++ b/qapi/qapi-dealloc-visitor.c
@@ -151,6 +151,14 @@ static void qapi_dealloc_type_number(Visitor *v, double *obj, const char *name,
{
}
+static void qapi_dealloc_type_anything(Visitor *v, QObject **obj,
+ const char *name, Error **errp)
+{
+ if (obj) {
+ qobject_decref(*obj);
+ }
+}
+
static void qapi_dealloc_type_size(Visitor *v, uint64_t *obj, const char *name,
Error **errp)
{
@@ -216,6 +224,7 @@ QapiDeallocVisitor *qapi_dealloc_visitor_new(void)
v->visitor.type_bool = qapi_dealloc_type_bool;
v->visitor.type_str = qapi_dealloc_type_str;
v->visitor.type_number = qapi_dealloc_type_number;
+ v->visitor.type_any = qapi_dealloc_type_anything;
v->visitor.type_size = qapi_dealloc_type_size;
v->visitor.start_union = qapi_dealloc_start_union;