diff mbox

[02/14] qerror: add new errors

Message ID 1337974879-3656-3-git-send-email-lcapitulino@redhat.com
State New
Headers show

Commit Message

Luiz Capitulino May 25, 2012, 7:41 p.m. UTC
New errors for write() and open() failures. Will be used by the
next commits.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
---
 qerror.c | 24 ++++++++++++++++++++++++
 qerror.h | 18 ++++++++++++++++++
 2 files changed, 42 insertions(+)
diff mbox

Patch

diff --git a/qerror.c b/qerror.c
index 2c97382..58e4570 100644
--- a/qerror.c
+++ b/qerror.c
@@ -152,6 +152,14 @@  static const QErrorStringTable qerror_table[] = {
         .desc      = "The feature '%(name)' is not enabled",
     },
     {
+        .error_fmt = QERR_FILE_TOO_BIG,
+        .desc      = "File exceeds maxium file size limit",
+    },
+    {
+        .error_fmt = QERR_INVALID_ACCESS,
+        .desc      = "The access is invalid",
+    },
+    {
         .error_fmt = QERR_INVALID_BLOCK_FORMAT,
         .desc      = "Invalid block format '%(name)'",
     },
@@ -209,10 +217,18 @@  static const QErrorStringTable qerror_table[] = {
         .desc      = "Parameter '%(name)' is missing",
     },
     {
+        .error_fmt = QERR_NAME_TOO_LONG,
+        .desc      = "Name is too longe",
+    },
+    {
         .error_fmt = QERR_NO_BUS_FOR_DEVICE,
         .desc      = "No '%(bus)' bus found for device '%(device)'",
     },
     {
+        .error_fmt = QERR_NO_SPACE,
+        .desc      = "No space left in device",
+    },
+    {
         .error_fmt = QERR_NOT_SUPPORTED,
         .desc      = "Not supported",
     },
@@ -271,6 +287,10 @@  static const QErrorStringTable qerror_table[] = {
         .desc      = "QMP input object member '%(member)' is unexpected",
     },
     {
+        .error_fmt = QERR_READ_ONLY_FS,
+        .desc      = "File System is read-only",
+    },
+    {
         .error_fmt = QERR_RESET_REQUIRED,
         .desc      = "Resetting the Virtual Machine is required",
     },
@@ -279,6 +299,10 @@  static const QErrorStringTable qerror_table[] = {
         .desc      = "Could not set password",
     },
     {
+        .error_fmt = QERR_TOO_MANY_FILES_PROC,
+        .desc      = "Too many opened files by the process",
+    },
+    {
         .error_fmt = QERR_TOO_MANY_FILES_SYS,
         .desc      = "Too many opened files in the system",
     },
diff --git a/qerror.h b/qerror.h
index 9ddf09c..e8dc9e7 100644
--- a/qerror.h
+++ b/qerror.h
@@ -136,6 +136,12 @@  QError *qobject_to_qerror(const QObject *obj);
 #define QERR_FEATURE_DISABLED \
     "{ 'class': 'FeatureDisabled', 'data': { 'name': %s } }"
 
+#define QERR_FILE_TOO_BIG \
+    "{ 'class': 'FileTooBig', 'data': {} }"
+
+#define QERR_INVALID_ACCESS \
+    "{ 'class': 'InvalidAccess', 'data': {} }"
+
 #define QERR_INVALID_BLOCK_FORMAT \
     "{ 'class': 'InvalidBlockFormat', 'data': { 'name': %s } }"
 
@@ -178,9 +184,15 @@  QError *qobject_to_qerror(const QObject *obj);
 #define QERR_MISSING_PARAMETER \
     "{ 'class': 'MissingParameter', 'data': { 'name': %s } }"
 
+#define QERR_NAME_TOO_LONG \
+    "{ 'class': 'NameTooLong', 'data': {} }"
+
 #define QERR_NO_BUS_FOR_DEVICE \
     "{ 'class': 'NoBusForDevice', 'data': { 'device': %s, 'bus': %s } }"
 
+#define QERR_NO_SPACE \
+    "{ 'class': 'NoSpace', 'data': {} }"
+
 #define QERR_NOT_SUPPORTED \
     "{ 'class': 'NotSupported', 'data': {} }"
 
@@ -224,12 +236,18 @@  QError *qobject_to_qerror(const QObject *obj);
 #define QERR_QMP_EXTRA_MEMBER \
     "{ 'class': 'QMPExtraInputObjectMember', 'data': { 'member': %s } }"
 
+#define QERR_READ_ONLY_FS \
+    "{ 'class': 'ReadOnlyFileSystem', 'data': {} }"
+
 #define QERR_RESET_REQUIRED \
     "{ 'class': 'ResetRequired', 'data': {} }"
 
 #define QERR_SET_PASSWD_FAILED \
     "{ 'class': 'SetPasswdFailed', 'data': {} }"
 
+#define QERR_TOO_MANY_FILES_PROC \
+    "{ 'class': 'TooManyFilesByProcess', 'data': {} }"
+
 #define QERR_TOO_MANY_FILES_SYS \
     "{ 'class': 'TooManyFilesInSystem', 'data': {} }"