[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC v5 003/126] error: rename errp to errp_in where it is IN-argume
From: |
Eric Blake |
Subject: |
Re: [RFC v5 003/126] error: rename errp to errp_in where it is IN-argument |
Date: |
Fri, 11 Oct 2019 13:29:53 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 |
On 10/11/19 11:03 AM, Vladimir Sementsov-Ogievskiy wrote:
Error **errp is almost always OUT-argument: it's assumed to be NULL, or
pointer to NULL-initialized pointer, or pointer to error_abort or
error_fatal, for callee to report error.
But very few functions instead get Error **errp as IN-argument:
it's assumed to be set (or, maybe, NULL), and callee should clean it,
or add some information.
In such cases, rename errp to errp_in.
This patch updates only error API functions. There still a few
functions with errp-in semantics, they will be updated in further
commits.
Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
include/qapi/error.h | 8 ++++----
util/error.c | 30 +++++++++++++++---------------
2 files changed, 19 insertions(+), 19 deletions(-)
+++ b/include/qapi/error.h
@@ -233,13 +233,13 @@ void error_propagate_prepend(Error **dst_errp, Error
*local_err,
* Prepend some text to @errp's human-readable error message.
* The text is made by formatting @fmt, @ap like vprintf().
*/
-void error_vprepend(Error **errp, const char *fmt, va_list ap);
+void error_vprepend(Error **errp_in, const char *fmt, va_list ap);
Fails to update the comment.
/*
* Prepend some text to @errp's human-readable error message.
* The text is made by formatting @fmt, ... like printf().
*/
-void error_prepend(Error **errp, const char *fmt, ...)
+void error_prepend(Error **errp_in, const char *fmt, ...)
and again
GCC_FMT_ATTR(2, 3);
/*
@@ -256,7 +256,7 @@ void error_prepend(Error **errp, const char *fmt, ...)
* May be called multiple times. The resulting hint should end with a
* newline.
*/
-void error_append_hint(Error **errp, const char *fmt, ...)
+void error_append_hint(Error **errp_in, const char *fmt, ...)
GCC_FMT_ATTR(2, 3);
/*
@@ -283,7 +283,7 @@ void error_free(Error *err);
/*
* Convenience function to assert that *@errp is set, then silently free it.
*/
-void error_free_or_abort(Error **errp);
+void error_free_or_abort(Error **errp_in);
and again.
Otherwise makes sense; if matching comments are the only things changed,
Reviewed-by: Eric Blake <address@hidden>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
- [RFC v5 000/126] error: auto propagated local_err, Vladimir Sementsov-Ogievskiy, 2019/10/11
- [RFC v5 002/126] net/net: Clean up variable shadowing in net_client_init(), Vladimir Sementsov-Ogievskiy, 2019/10/11
- [RFC v5 001/126] hw/core/loader-fit: fix freeing errp in fit_load_fdt, Vladimir Sementsov-Ogievskiy, 2019/10/11
- [RFC v5 003/126] error: rename errp to errp_in where it is IN-argument, Vladimir Sementsov-Ogievskiy, 2019/10/11
- Re: [RFC v5 003/126] error: rename errp to errp_in where it is IN-argument,
Eric Blake <=
- [RFC v5 007/126] nbd: well form nbd_iter_channel_error errp handler, Vladimir Sementsov-Ogievskiy, 2019/10/11
- [RFC v5 005/126] vnc: drop Error pointer indirection in vnc_client_io_error, Vladimir Sementsov-Ogievskiy, 2019/10/11
- [RFC v5 006/126] qdev-monitor: well form error hint helpers, Vladimir Sementsov-Ogievskiy, 2019/10/11
- [RFC v5 011/126] block/snapshot: rename Error ** parameter to more common errp, Vladimir Sementsov-Ogievskiy, 2019/10/11
- [RFC v5 004/126] hmp: drop Error pointer indirection in hmp_handle_error, Vladimir Sementsov-Ogievskiy, 2019/10/11