[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 04/15] QError: Add errors used by QMP
From: |
Luiz Capitulino |
Subject: |
[Qemu-devel] [PATCH 04/15] QError: Add errors used by QMP |
Date: |
Thu, 19 Nov 2009 13:13:32 -0200 |
NOTE: These errors where added quickly to satisfy immediate needs,
they need to be reviewed.
Signed-off-by: Luiz Capitulino <address@hidden>
---
qerror.c | 20 ++++++++++++++++++++
qerror.h | 15 +++++++++++++++
2 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/qerror.c b/qerror.c
index d8b125e..4349417 100644
--- a/qerror.c
+++ b/qerror.c
@@ -52,6 +52,26 @@ const QErrorStringTable qerror_table[] = {
.error_fmt = QERR_KVM_MISSING_CAP,
.desc = "Using KVM without %(capability), %(feature) unavailable",
},
+ {
+ .error_fmt = QERR_BAD_SYNTAX,
+ .desc = "wrong syntax: '%(reason)",
+ },
+ {
+ .error_fmt = QERR_COMMAND_NOT_FOUND,
+ .desc = "command: %(name)",
+ },
+ {
+ .error_fmt = QERR_COMMAND_NOT_ISSUED,
+ .desc = "a command should be issued",
+ },
+ {
+ .error_fmt = QERR_INVALID_PARAMETER,
+ .desc = "invalid parameter '%(parameter)': %(reason)",
+ },
+ {
+ .error_fmt = QERR_UNDEFINED_ERROR,
+ .desc = "an error has ocurred: %(hint)",
+ },
{}
};
diff --git a/qerror.h b/qerror.h
index 6c100af..1b704e4 100644
--- a/qerror.h
+++ b/qerror.h
@@ -47,4 +47,19 @@ QError *qobject_to_qerror(const QObject *obj);
#define QERR_KVM_MISSING_CAP \
"{ 'class': 'KVMMissingCap', 'data': { 'capability': %s, 'feature': %s
} }"
+#define QERR_BAD_SYNTAX \
+ "{ 'class': 'BadSyntax', 'data': { 'reason': %s } }"
+
+#define QERR_COMMAND_NOT_FOUND \
+ "{ 'class': 'CommandNotFound', 'data': { 'name': %s } }"
+
+#define QERR_COMMAND_NOT_ISSUED \
+ "{ 'class': 'CommandNotIssued', 'data': { } }"
+
+#define QERR_INVALID_PARAMETER \
+ "{ 'class': 'InvalidParameter', 'data': { 'parameter': %s, 'reason':
%s } }"
+
+#define QERR_UNDEFINED_ERROR \
+ "{ 'class': 'UndefinedError', 'data': { 'hint': %s } }"
+
#endif /* QERROR_H */
--
1.6.5.3.148.g785c5
- [Qemu-devel] [RFC v0 00/15] QEMU Monitor Protocol, Luiz Capitulino, 2009/11/19
- [Qemu-devel] [PATCH 01/15] monitor: Introduce MONITOR_USE_CONTROL flag, Luiz Capitulino, 2009/11/19
- [Qemu-devel] [PATCH 02/15] monitor: Command-line flag to enable control mode, Luiz Capitulino, 2009/11/19
- [Qemu-devel] [PATCH 03/15] monitor: Move handler calling code to its own function, Luiz Capitulino, 2009/11/19
- [Qemu-devel] [PATCH 04/15] QError: Add errors used by QMP,
Luiz Capitulino <=
- [Qemu-devel] [PATCH 05/15] QMP: chardev handling, Luiz Capitulino, 2009/11/19
- [Qemu-devel] [PATCH 06/15] QMP: Output support, Luiz Capitulino, 2009/11/19
- [Qemu-devel] [PATCH 07/15] QMP: Input support, Luiz Capitulino, 2009/11/19
- [Qemu-devel] [PATCH 08/15] QMP: Asynchronous events infrastructure, Luiz Capitulino, 2009/11/19
- [Qemu-devel] [PATCH 09/15] QMP: Introduce basic asynchronous events, Luiz Capitulino, 2009/11/19
- [Qemu-devel] [PATCH 10/15] QMP: Disable monitor print functions, Luiz Capitulino, 2009/11/19
- [Qemu-devel] [PATCH 11/15] QMP: Introduce README file, Luiz Capitulino, 2009/11/19
- [Qemu-devel] [PATCH 12/15] QMP: Introduce specification, Luiz Capitulino, 2009/11/19
- [Qemu-devel] [PATCH 13/15] QMP: Introduce qmp-events.txt, Luiz Capitulino, 2009/11/19
- [Qemu-devel] [PATCH 14/15] QMP: Introduce qmp-shell, Luiz Capitulino, 2009/11/19