[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 06/22] qapi: add JSON parsing error message
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH 06/22] qapi: add JSON parsing error message |
Date: |
Sun, 6 Mar 2011 19:22:48 -0600 |
Using a string like this is a cop-out. I plan on changing this before 0.15.
Signed-off-by: Anthony Liguori <address@hidden>
diff --git a/qerror.c b/qerror.c
index 5a1e637..c12dd3d 100644
--- a/qerror.c
+++ b/qerror.c
@@ -145,6 +145,10 @@ static const QErrorStringTable qerror_table[] = {
.desc = "Invalid JSON syntax",
},
{
+ .error_fmt = QERR_JSON_PARSE_ERROR,
+ .desc = "Error parsing JSON: %(message)",
+ },
+ {
.error_fmt = QERR_KVM_MISSING_CAP,
.desc = "Using KVM without %(capability), %(feature) unavailable",
},
diff --git a/qerror.h b/qerror.h
index 35e7253..a0fb98d 100644
--- a/qerror.h
+++ b/qerror.h
@@ -125,6 +125,9 @@ void qerror_set_desc(QError *qerr, const char *fmt);
#define QERR_JSON_PARSING \
"{ 'class': 'JSONParsing', 'data': {} }"
+#define QERR_JSON_PARSE_ERROR \
+ "{ 'class': 'JSONParseError', 'data': { 'message': %s } }"
+
#define QERR_KVM_MISSING_CAP \
"{ 'class': 'KVMMissingCap', 'data': { 'capability': %s, 'feature': %s } }"
--
1.7.0.4
- Re: [Qemu-devel] [PATCH 03/22] qapi: add Error object, (continued)
[Qemu-devel] [PATCH 10/22] qapi: add core QMP server support, Anthony Liguori, 2011/03/06
[Qemu-devel] [PATCH 12/22] qapi: add QAPI module type, Anthony Liguori, 2011/03/06
[Qemu-devel] [PATCH 06/22] qapi: add JSON parsing error message,
Anthony Liguori <=
[Qemu-devel] [PATCH 13/22] qapi: add code generators for QMP command marshaling, Anthony Liguori, 2011/03/06
[Qemu-devel] [PATCH 15/22] qapi: add new QMP server that uses CharDriverState, Anthony Liguori, 2011/03/06
[Qemu-devel] [PATCH 14/22] qapi: add query-version QMP command, Anthony Liguori, 2011/03/06