Added new messages to be used(initially) on vl.c

Signed-off-by: Leandro Dorileo <ldori...@gmail.com>
---
 qerror.c |   33 +++++++++++++++++++++++++++++++++
 qerror.h |   18 ++++++++++++++++++
 2 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/qerror.c b/qerror.c
index 8d885cd..92c8047 100644
--- a/qerror.c
+++ b/qerror.c
@@ -129,10 +129,31 @@ static const QErrorStringTable qerror_table[] = {
         .desc      = "Parameter '%(name)' expects %(expected)",
     },
     {
+        .error_fmt = QERR_INVALID_PHYSICAL_FORMAT,
+        .desc      = "'%(bus_type)' invalid physical %(property) format",
+    },
+    {
+        .error_fmt = QERR_INVALID_PHYSICAL_NUMBER,
+        .desc      = "'%(bus_type)' invalid physical %(property) number",
+    },
+    {
+        .error_fmt = QERR_INVALID_PHYSICAL_FORMAT,
+        .desc      = "'%(bus_type)' invalid physical %(property) format",
+    },
+    {
+        .error_fmt = QERR_INVALID_PHYSICAL_NUMBER,
+        .desc      = "'%(bus_type)' invalid physical %(property) number",
+    },
+
+    {
         .error_fmt = QERR_INVALID_PASSWORD,
         .desc      = "Password incorrect",
     },
     {
+        .error_fmt = QERR_INVALID_UNIT_SIZE,
+        .desc      = "Unit %(size) too big (max is %(max_size))",
+    },
+    {
         .error_fmt = QERR_JSON_PARSING,
         .desc      = "Invalid JSON syntax",
     },
@@ -185,6 +206,18 @@ static const QErrorStringTable qerror_table[] = {
         .desc      = "An undefined error has ocurred",
     },
     {
+        .error_fmt = QERR_UNSUPPORTED_BUS_TYPE,
+        .desc      = "Unsupported bus type '%(bus_type)'",
+    },
+    {
+        .error_fmt = QERR_UNSUPPORTED_FLAG,
+        .desc      = "%(flag) flag not supported for drive with %(type) 
interface",
+    },
+    {
+        .error_fmt = QERR_UNSUPPORTED_PARAMETER_BY,
+        .desc      = "%(parameter) is no supported by %(resource)",
+    },
+    {
         .error_fmt = QERR_VNC_SERVER_FAILED,
         .desc      = "Could not start VNC server on %(target)",
     },
diff --git a/qerror.h b/qerror.h
index bae08c0..62d0af3 100644
--- a/qerror.h
+++ b/qerror.h
@@ -112,9 +112,18 @@ QError *qobject_to_qerror(const QObject *obj);
 #define QERR_INVALID_PARAMETER_VALUE \
     "{ 'class': 'InvalidParameterValue', 'data': { 'name': %s, 'expected': %s 
} }"
 
+#define QERR_INVALID_PHYSICAL_FORMAT \
+    "{ 'class': 'InvalidPhysicalFormat', 'data': { 'bus_type': %s, 'property': 
%s } }"
+
+#define QERR_INVALID_PHYSICAL_NUMBER \
+    "{ 'class': 'InvalidPhysicalNumber', 'data': { 'bus_type': %s, 'property': 
%s } }"
+
 #define QERR_INVALID_PASSWORD \
     "{ 'class': 'InvalidPassword', 'data': {} }"
 
+#define QERR_INVALID_UNIT_SIZE \
+    "{ 'class': 'InvalidUnitSize', 'data': {size: %d, 'max_size': %d} }"
+
 #define QERR_JSON_PARSING \
     "{ 'class': 'JSONParsing', 'data': {} }"
 
@@ -154,6 +163,15 @@ QError *qobject_to_qerror(const QObject *obj);
 #define QERR_UNDEFINED_ERROR \
     "{ 'class': 'UndefinedError', 'data': {} }"
 
+#define QERR_UNSUPPORTED_BUS_TYPE \
+    "{ 'class': 'UnsupportedBusType', 'data': {'bus_type': %s} }"
+
+#define QERR_UNSUPPORTED_FLAG \
+    "{ 'class': 'UnsupportedFlag', 'data': {'flag': %s, 'type': %s} }"
+
+#define QERR_UNSUPPORTED_PARAMETER_BY \
+    "{ 'class': 'UnsupportedParameterBy', 'data': {'parameter': %s, 
'resource': %s} }"
+
 #define QERR_VNC_SERVER_FAILED \
     "{ 'class': 'VNCServerFailed', 'data': { 'target': %s } }"
 
-- 
1.6.6.1



Reply via email to