aboutsummaryrefslogtreecommitdiff
path: root/include/qapi/qmp/qlist.h
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2022-03-23 19:57:20 +0400
committerPaolo Bonzini <pbonzini@redhat.com>2022-04-06 10:50:38 +0200
commitd709bbf3b17f43c91e82c3807a39f2c349d27934 (patch)
tree30e0ae475c7716d412000b7c2403092363a8afaf /include/qapi/qmp/qlist.h
parent7773e13fa729bbd2b106121b6c63b11a46c7d0c4 (diff)
include/qapi: add g_autoptr support for qobject types
Need wrappers for qobject_unref() calls, which is a macro. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220323155743.1585078-10-marcandre.lureau@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/qapi/qmp/qlist.h')
-rw-r--r--include/qapi/qmp/qlist.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/qapi/qmp/qlist.h b/include/qapi/qmp/qlist.h
index 06e98ad5f4..e4e985d435 100644
--- a/include/qapi/qmp/qlist.h
+++ b/include/qapi/qmp/qlist.h
@@ -26,6 +26,10 @@ struct QList {
QTAILQ_HEAD(,QListEntry) head;
};
+void qlist_unref(QList *q);
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(QList, qlist_unref)
+
#define qlist_append(qlist, obj) \
qlist_append_obj(qlist, QOBJECT(obj))