[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/16] qapi/error: add g_autoptr(Error) support
From: |
marcandre . lureau |
Subject: |
[PATCH 10/16] qapi/error: add g_autoptr(Error) support |
Date: |
Wed, 4 May 2022 21:30:19 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Sometime, ERRP_GUARD() isn't what you are looking for, because the
function doesn't throw errors, yet auto-cleaning is nice to have.
Signed-off-by: Marc-André Lureau <marcandre.lureau@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 d798faeec3e9..9482b6a58ae6 100644
--- a/include/qapi/error.h
+++ b/include/qapi/error.h
@@ -519,6 +519,8 @@ static inline void error_propagator_cleanup(ErrorPropagator
*prop)
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(ErrorPropagator, error_propagator_cleanup);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(Error, error_free);
+
/*
* Special error destination to abort on error.
* See error_setg() and error_propagate() for details.
--
2.36.0.44.g0f828332d5ac
- Re: [PATCH 03/16] tests: make libqmp buildable for win32, (continued)
- [PATCH 04/16] compiler.h: add QEMU_{BEGIN, END}_IGNORE_INITIALIZER_OVERRIDES, marcandre . lureau, 2022/05/04
- [PATCH 05/16] qobject/json-lexer: disable -Winitializer-overrides warnings, marcandre . lureau, 2022/05/04
- [PATCH 06/16] include: adjust header guards after renaming, marcandre . lureau, 2022/05/04
- [PATCH 07/16] qga: flatten safe_open_or_create(), marcandre . lureau, 2022/05/04
- [PATCH 09/16] qga: use qemu_open_cloexec() for safe_open_or_create(), marcandre . lureau, 2022/05/04
- [PATCH 08/16] osdep: export qemu_open_cloexec(), marcandre . lureau, 2022/05/04
- [PATCH 10/16] qapi/error: add g_autoptr(Error) support,
marcandre . lureau <=
- [PATCH 11/16] qga: replace qemu_open_old() with qemu_open_cloexec(), marcandre . lureau, 2022/05/04
- [PATCH 12/16] test/qga: use G_TEST_DIR to locate os-release test file, marcandre . lureau, 2022/05/04
- [PATCH 13/16] qga/wixl: prefer variables over environment, marcandre . lureau, 2022/05/04
- [PATCH 14/16] qga/wixl: require Mingw_bin, marcandre . lureau, 2022/05/04
- [PATCH 15/16] qga/wixl: simplify some pre-processing, marcandre . lureau, 2022/05/04
- [PATCH 16/16] qga/wixl: replace QEMU_GA_MSI_MINGW_BIN_PATH with glib bindir, marcandre . lureau, 2022/05/04
- Re: [PATCH 00/16] Misc cleanups, Paolo Bonzini, 2022/05/05