Patchwork [03/11] QError: Add QMP mode-oriented errors

login
register
mail settings
Submitter Luiz Capitulino
Date Jan. 21, 2010, 9:09 p.m.
Message ID <1264108180-3666-4-git-send-email-lcapitulino@redhat.com>
Download mbox | patch
Permalink /patch/43454/
State New
Headers show

Comments

Luiz Capitulino - Jan. 21, 2010, 9:09 p.m.
Two new errors:

- QERR_QMP_INVALID_MODE_NAME
- QERR_QMP_INVALID_MODE_TRANSACTION

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 qerror.c |    8 ++++++++
 qerror.h |    6 ++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

Patch

diff --git a/qerror.c b/qerror.c
index 5f8fc5d..9dd729a 100644
--- a/qerror.c
+++ b/qerror.c
@@ -105,6 +105,14 @@  static const QErrorStringTable qerror_table[] = {
         .desc      = "Bad QMP input object",
     },
     {
+        .error_fmt = QERR_QMP_INVALID_MODE_NAME,
+        .desc      = "Mode name %(name) is invalid",
+    },
+    {
+        .error_fmt = QERR_QMP_INVALID_MODE_TRANSACTION,
+        .desc      = "Invalid mode transaction",
+    },
+    {
         .error_fmt = QERR_SET_PASSWD_FAILED,
         .desc      = "Could not set password",
     },
diff --git a/qerror.h b/qerror.h
index 9e220d6..9982d57 100644
--- a/qerror.h
+++ b/qerror.h
@@ -88,6 +88,12 @@  QError *qobject_to_qerror(const QObject *obj);
 #define QERR_QMP_BAD_INPUT_OBJECT \
     "{ 'class': 'QMPBadInputObject', 'data': { 'expected': %s } }"
 
+#define QERR_QMP_INVALID_MODE_NAME \
+    "{ 'class': 'QMPInvalidModeName', 'data': { 'name': %s } }"
+
+#define QERR_QMP_INVALID_MODE_TRANSACTION \
+    "{ 'class': 'QMPInvalidModeTransaction', 'data': {} }"
+
 #define QERR_SET_PASSWD_FAILED \
     "{ 'class': 'SetPasswdFailed', 'data': {} }"