[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 28/35] error: drop unused functions
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 28/35] error: drop unused functions |
Date: |
Tue, 7 Aug 2012 12:53:39 -0300 |
Besides of being unused, they operate on the current error format,
which is going to be replaced soon.
Signed-off-by: Luiz Capitulino <address@hidden>
---
error.c | 48 ------------------------------------------------
error.h | 16 ----------------
error_int.h | 1 -
3 files changed, 65 deletions(-)
diff --git a/error.c b/error.c
index 2d34cde..b1d5131 100644
--- a/error.c
+++ b/error.c
@@ -74,29 +74,6 @@ const char *error_get_pretty(Error *err)
return err->msg;
}
-const char *error_get_field(Error *err, const char *field)
-{
- if (strcmp(field, "class") == 0) {
- return qdict_get_str(err->obj, field);
- } else {
- QDict *dict = qdict_get_qdict(err->obj, "data");
- return qdict_get_str(dict, field);
- }
-}
-
-QDict *error_get_data(Error *err)
-{
- QDict *data = qdict_get_qdict(err->obj, "data");
- QINCREF(data);
- return data;
-}
-
-void error_set_field(Error *err, const char *field, const char *value)
-{
- QDict *dict = qdict_get_qdict(err->obj, "data");
- qdict_put(dict, field, qstring_from_str(value));
-}
-
void error_free(Error *err)
{
if (err) {
@@ -106,31 +83,6 @@ void error_free(Error *err)
}
}
-bool error_is_type(Error *err, ErrorClass err_class, const char *fmt)
-{
- const char *error_class;
- char *ptr;
- char *end;
-
- if (!err) {
- return false;
- }
-
- ptr = strstr(fmt, "'class': '");
- assert(ptr != NULL);
- ptr += strlen("'class': '");
-
- end = strchr(ptr, '\'');
- assert(end != NULL);
-
- error_class = error_get_field(err, "class");
- if (strlen(error_class) != end - ptr) {
- return false;
- }
-
- return strncmp(ptr, error_class, end - ptr) == 0;
-}
-
void error_propagate(Error **dst_err, Error *local_err)
{
if (dst_err && !*dst_err) {
diff --git a/error.h b/error.h
index 114e24b..5336fc5 100644
--- a/error.h
+++ b/error.h
@@ -51,16 +51,6 @@ Error *error_copy(const Error *err);
const char *error_get_pretty(Error *err);
/**
- * Get an individual named error field.
- */
-const char *error_get_field(Error *err, const char *field);
-
-/**
- * Get an individual named error field.
- */
-void error_set_field(Error *err, const char *field, const char *value);
-
-/**
* Propagate an error to an indirect pointer to an error. This function will
* always transfer ownership of the error reference and handles the case where
* dst_err is NULL correctly. Errors after the first are discarded.
@@ -72,10 +62,4 @@ void error_propagate(Error **dst_err, Error *local_err);
*/
void error_free(Error *err);
-/**
- * Determine if an error is of a speific type (based on the qerror format).
- * Non-QEMU users should get the `class' field to identify the error type.
- */
-bool error_is_type(Error *err, ErrorClass err_class, const char *fmt);
-
#endif
diff --git a/error_int.h b/error_int.h
index 5e39424..4b00d08 100644
--- a/error_int.h
+++ b/error_int.h
@@ -22,7 +22,6 @@
*
* These are used to convert QErrors to Errors
*/
-QDict *error_get_data(Error *err);
QObject *error_get_qobject(Error *err);
void error_set_qobject(Error **errp, QObject *obj);
--
1.7.11.2.249.g31c7954.dirty
- Re: [Qemu-devel] [PATCH 35/35] docs: writing-qmp-commands.txt: update error section, (continued)
- [Qemu-devel] [PATCH 33/35] qerror: drop qerror_table and qerror_format(), Luiz Capitulino, 2012/08/07
- [Qemu-devel] [PATCH 31/35] error: drop error_get_qobject()/error_set_qobject(), Luiz Capitulino, 2012/08/07
- [Qemu-devel] [PATCH 11/35] qmp: query-block: add 'valid_encryption_key' field, Luiz Capitulino, 2012/08/07
- [Qemu-devel] [PATCH 16/35] qerror: drop QERR_SOCKET_CONNECT_IN_PROGRESS, Luiz Capitulino, 2012/08/07
- [Qemu-devel] [PATCH 18/35] hmp: hmp.h: include qdict.h, Luiz Capitulino, 2012/08/07
- [Qemu-devel] [PATCH 34/35] error, qerror: drop QDict member, Luiz Capitulino, 2012/08/07
- [Qemu-devel] [PATCH 23/35] qerror: qerror_table: don't use C99 struct initializers, Luiz Capitulino, 2012/08/07
- [Qemu-devel] [PATCH 21/35] qapi: don't convert enum strings to lowercase, Luiz Capitulino, 2012/08/07
- [Qemu-devel] [PATCH 25/35] qerror: add proper ErrorClass value for QERR_ macros, Luiz Capitulino, 2012/08/07
- [Qemu-devel] [PATCH 28/35] error: drop unused functions,
Luiz Capitulino <=
- [Qemu-devel] [PATCH 29/35] qmp: switch to the new error format on the wire, Luiz Capitulino, 2012/08/07
- [Qemu-devel] [PATCH 06/35] qerror: avoid passing qerr pointer, Luiz Capitulino, 2012/08/07
- [Qemu-devel] [PATCH 04/35] qerror: reduce public exposure, Luiz Capitulino, 2012/08/07
- [Qemu-devel] [PATCH 14/35] net: inet_connect(), inet_connect_opts(): add in_progress argument, Luiz Capitulino, 2012/08/07
- [Qemu-devel] [PATCH 32/35] error, qerror: pass desc string to error calls, Luiz Capitulino, 2012/08/07
- [Qemu-devel] [PATCH 26/35] error: add error_get_class(), Luiz Capitulino, 2012/08/07
- [Qemu-devel] [PATCH 22/35] qapi-schema: add ErrorClass enum, Luiz Capitulino, 2012/08/07
- [Qemu-devel] [PATCH 19/35] qapi: qapi-types.h: don't include qapi/qapi-types-core.h, Luiz Capitulino, 2012/08/07