All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] qapi: define cleanup function for g_autoptr(Error)
@ 2021-09-12 12:48 Paolo Bonzini
  2021-09-12 13:22 ` Richard Henderson
  2021-09-13  5:23 ` Markus Armbruster
  0 siblings, 2 replies; 9+ messages in thread
From: Paolo Bonzini @ 2021-09-12 12:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: berrange, armbru

Allow replacing calls to error_free() with g_autoptr(Error)
declarations.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/qapi/error.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/qapi/error.h b/include/qapi/error.h
index 4a9260b0cc..8564657baf 100644
--- a/include/qapi/error.h
+++ b/include/qapi/error.h
@@ -437,6 +437,8 @@ Error *error_copy(const Error *err);
  */
 void error_free(Error *err);
 
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(Error, error_free);
+
 /*
  * Convenience function to assert that *@errp is set, then silently free it.
  */
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-09-14  4:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-12 12:48 [PATCH] qapi: define cleanup function for g_autoptr(Error) Paolo Bonzini
2021-09-12 13:22 ` Richard Henderson
2021-09-13  5:23 ` Markus Armbruster
2021-09-13  7:30   ` Paolo Bonzini
2021-09-13  8:25     ` Daniel P. Berrangé
2021-09-13  9:31     ` Markus Armbruster
2021-09-13 13:08       ` Markus Armbruster
2021-09-13 15:09         ` Philippe Mathieu-Daudé
2021-09-14  4:46           ` Markus Armbruster

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.