[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 07/48] qerror: QError: drop file, linenr, func
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 07/48] qerror: QError: drop file, linenr, func |
Date: |
Mon, 13 Aug 2012 16:48:28 -0300 |
They have never been fully used and conflict with future error
improvements.
Also makes qerror_report() a proper function, as there's no point
in having it as a macro anymore.
Signed-off-by: Luiz Capitulino <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
---
qerror.c | 20 +++-----------------
qerror.h | 8 +-------
2 files changed, 4 insertions(+), 24 deletions(-)
diff --git a/qerror.c b/qerror.c
index e717496..6f9f49c 100644
--- a/qerror.c
+++ b/qerror.c
@@ -404,27 +404,14 @@ static const QErrorStringTable *get_desc_no_fail(const
char *fmt)
/**
* qerror_from_info(): Create a new QError from error information
*
- * The information consists of:
- *
- * - file the file name of where the error occurred
- * - linenr the line number of where the error occurred
- * - func the function name of where the error occurred
- * - fmt JSON printf-like dictionary, there must exist keys 'class' and
- * 'data'
- * - va va_list of all arguments specified by fmt
- *
* Return strong reference.
*/
-static QError *qerror_from_info(const char *file, int linenr, const char *func,
- const char *fmt, va_list *va)
+static QError *qerror_from_info(const char *fmt, va_list *va)
{
QError *qerr;
qerr = qerror_new();
loc_save(&qerr->loc);
- qerr->linenr = linenr;
- qerr->file = file;
- qerr->func = func;
qerr->error = error_obj_from_fmt_no_fail(fmt, va);
qerr->entry = get_desc_no_fail(fmt);
@@ -545,14 +532,13 @@ static void qerror_print(QError *qerror)
QDECREF(qstring);
}
-void qerror_report_internal(const char *file, int linenr, const char *func,
- const char *fmt, ...)
+void qerror_report(const char *fmt, ...)
{
va_list va;
QError *qerror;
va_start(va, fmt);
- qerror = qerror_from_info(file, linenr, func, fmt, &va);
+ qerror = qerror_from_info(fmt, &va);
va_end(va);
if (monitor_cur_is_qmp()) {
diff --git a/qerror.h b/qerror.h
index fe8870c..3c0b14c 100644
--- a/qerror.h
+++ b/qerror.h
@@ -27,20 +27,14 @@ typedef struct QError {
QObject_HEAD;
QDict *error;
Location loc;
- int linenr;
- const char *file;
- const char *func;
const QErrorStringTable *entry;
} QError;
QString *qerror_human(const QError *qerror);
-void qerror_report_internal(const char *file, int linenr, const char *func,
- const char *fmt, ...) GCC_FMT_ATTR(4, 5);
+void qerror_report(const char *fmt, ...) GCC_FMT_ATTR(1, 2);
void qerror_report_err(Error *err);
void assert_no_error(Error *err);
QString *qerror_format(const char *fmt, QDict *error);
-#define qerror_report(fmt, ...) \
- qerror_report_internal(__FILE__, __LINE__, __func__, fmt, ## __VA_ARGS__)
/*
* QError class list
--
1.7.11.2.249.g31c7954.dirty
- [Qemu-devel] [PULL 00/48]: QMP queue, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 01/48] monitor: drop unused monitor debug code, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 02/48] qerror: QERR_AMBIGUOUS_PATH: drop %(object) from human msg, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 03/48] qerror: QERR_DEVICE_ENCRYPTED: change error message, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 04/48] qerror: reduce public exposure, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 05/48] qerror: drop qerror_abort(), Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 06/48] qerror: avoid passing qerr pointer, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 08/48] qerror: qerror_format(): return an allocated string, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 07/48] qerror: QError: drop file, linenr, func,
Luiz Capitulino <=
- [Qemu-devel] [PATCH 10/48] error: don't delay error message construction, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 11/48] qmp: query-block: add 'encryption_key_missing' field, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 09/48] qerror: don't delay error message construction, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 12/48] hmp: hmp_cont(): don't rely on QERR_DEVICE_ENCRYPTED, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 14/48] net: inet_connect(), inet_connect_opts(): add in_progress argument, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 13/48] hmp_change(): don't access DeviceEncrypted's data, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 16/48] qerror: drop QERR_SOCKET_CONNECT_IN_PROGRESS, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 15/48] migration: don't rely on any QERR_SOCKET_*, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 17/48] block: block_int: include qerror.h, Luiz Capitulino, 2012/08/13
- [Qemu-devel] [PATCH 20/48] qapi: generate correct enum names for camel case enums, Luiz Capitulino, 2012/08/13