@@ -16,7 +16,7 @@
#include "qemu/readline.h"
-void hmp_handle_error(Monitor *mon, Error **errp);
+void hmp_handle_error(Monitor *mon, Error **errp_in);
void hmp_info_name(Monitor *mon, const QDict *qdict);
void hmp_info_version(Monitor *mon, const QDict *qdict);
@@ -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);
/*
* Convenience function to warn_report() and free @err.
@@ -301,19 +301,19 @@ void error_report_err(Error *err);
* Functions to clean Error **errp: call corresponding Error *err cleaning
* function an set pointer to NULL
*/
-static inline void error_free_errp(Error **errp)
+static inline void error_free_errp(Error **errp_in)
{
error_free(*errp_in);
*errp_in = NULL;
}
-static inline void error_report_errp(Error **errp)
+static inline void error_report_errp(Error **errp_in)
{
error_report_err(*errp_in);
*errp_in = NULL;
}
-static inline void warn_report_errp(Error **errp)
+static inline void warn_report_errp(Error **errp_in)
{
warn_report_err(*errp_in);
*errp_in = NULL;
@@ -547,7 +547,7 @@ uint32_t read_u32(uint8_t *data, size_t offset);
/* Protocol stage functions */
void vnc_client_error(VncState *vs);
-size_t vnc_client_io_error(VncState *vs, ssize_t ret, Error **errp);
+size_t vnc_client_io_error(VncState *vs, ssize_t ret, Error **errp_in);
void start_client_init(VncState *vs);
void start_auth_vnc(VncState *vs);
@@ -60,11 +60,11 @@
#include <spice/enums.h>
#endif
-void hmp_handle_error(Monitor *mon, Error **errp)
+void hmp_handle_error(Monitor *mon, Error **errp_in)
{
- assert(errp);
- if (*errp) {
- error_reportf_err(*errp, "Error: ");
+ assert(errp_in);
+ if (*errp_in) {
+ error_reportf_err(*errp_in, "Error: ");
}
}
@@ -1312,7 +1312,7 @@ void vnc_disconnect_finish(VncState *vs)
g_free(vs);
}
-size_t vnc_client_io_error(VncState *vs, ssize_t ret, Error **errp)
+size_t vnc_client_io_error(VncState *vs, ssize_t ret, Error **errp_in)
{
if (ret <= 0) {
if (ret == 0) {
@@ -1320,14 +1320,14 @@ size_t vnc_client_io_error(VncState *vs, ssize_t ret, Error **errp)
vnc_disconnect_start(vs);
} else if (ret != QIO_CHANNEL_ERR_BLOCK) {
trace_vnc_client_io_error(vs, vs->ioc,
- errp ? error_get_pretty(*errp) :
+ errp_in ? error_get_pretty(*errp_in) :
"Unknown");
vnc_disconnect_start(vs);
}
- if (errp) {
- error_free(*errp);
- *errp = NULL;
+ if (errp_in) {
+ error_free(*errp_in);
+ *errp_in = NULL;
}
return 0;
}
@@ -271,7 +271,7 @@ void error_free(Error *err)
}
}
-void error_free_or_abort(Error **errp)
+void error_free_or_abort(Error **errp_in)
{
assert(errp_in && *errp_in);
error_free(*errp_in);
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 (most of the are error API) instead get Error **errp as IN-argument: it's assumed to be set, and callee should clean it. In such cases, rename errp to errp_in. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> --- include/monitor/hmp.h | 2 +- include/qapi/error.h | 8 ++++---- ui/vnc.h | 2 +- monitor/hmp-cmds.c | 8 ++++---- ui/vnc.c | 10 +++++----- util/error.c | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-)