summaryrefslogtreecommitdiffstats
path: root/include/qapi/qmp/qstring.h
diff options
context:
space:
mode:
authorMarc-André Lureau2022-03-23 16:57:20 +0100
committerPaolo Bonzini2022-04-06 10:50:38 +0200
commitd709bbf3b17f43c91e82c3807a39f2c349d27934 (patch)
tree30e0ae475c7716d412000b7c2403092363a8afaf /include/qapi/qmp/qstring.h
parentosdep: poison {HOST,TARGET}_WORDS_BIGENDIAN (diff)
downloadqemu-d709bbf3b17f43c91e82c3807a39f2c349d27934.tar.gz
qemu-d709bbf3b17f43c91e82c3807a39f2c349d27934.tar.xz
qemu-d709bbf3b17f43c91e82c3807a39f2c349d27934.zip
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/qstring.h')
-rw-r--r--include/qapi/qmp/qstring.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/qapi/qmp/qstring.h b/include/qapi/qmp/qstring.h
index 1d8ba46936..318d815d6a 100644
--- a/include/qapi/qmp/qstring.h
+++ b/include/qapi/qmp/qstring.h
@@ -20,6 +20,10 @@ struct QString {
const char *string;
};
+void qstring_unref(QString *q);
+
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(QString, qstring_unref)
+
QString *qstring_new(void);
QString *qstring_from_str(const char *str);
QString *qstring_from_substr(const char *str, size_t start, size_t end);