Patchwork [V5,2/4] Qemu: qerrors for file reopen, data sync and cmd syntax

login
register
mail settings
Submitter Supriya Kannery
Date July 27, 2011, 11:30 a.m.
Message ID <20110727113027.25109.33096.sendpatchset@skannery>
Download mbox | patch
Permalink /patch/107032/
State New
Headers show

Comments

Supriya Kannery - July 27, 2011, 11:30 a.m.
New error classes defined for file reopen failure, data
sync error and incorrect command syntax

Signed-off-by: Supriya Kannery <supriyak@in.ibm.com>

---
 qerror.c |   12 ++++++++++++
 qerror.h |    8 ++++++++
 2 files changed, 20 insertions(+)

Patch

Index: qemu/qerror.c
===================================================================
--- qemu.orig/qerror.c
+++ qemu/qerror.c
@@ -97,6 +97,14 @@  static const QErrorStringTable qerror_ta
         .desc      = "Device '%(device)' is not removable",
     },
     {
+        .error_fmt = QERR_DATA_SYNC_FAILED,
+        .desc      = "Syncing of data failed for device '%(device)'",
+    },
+    {
+        .error_fmt = QERR_REOPEN_FILE_FAILED,
+        .desc      = "Could not reopen '%(filename)'",
+    },
+    {
         .error_fmt = QERR_DEVICE_NO_BUS,
         .desc      = "Device '%(device)' has no child bus",
     },
@@ -230,6 +238,10 @@  static const QErrorStringTable qerror_ta
         .error_fmt = QERR_QGA_COMMAND_FAILED,
         .desc      = "Guest agent command failed, error was '%(message)'",
     },
+    {
+        .error_fmt = QERR_INCORRECT_COMMAND_SYNTAX,
+        .desc      = "Usage: %(syntax)",
+    },
     {}
 };
 
Index: qemu/qerror.h
===================================================================
--- qemu.orig/qerror.h
+++ qemu/qerror.h
@@ -85,6 +85,9 @@  QError *qobject_to_qerror(const QObject 
 #define QERR_DEVICE_NOT_FOUND \
     "{ 'class': 'DeviceNotFound', 'data': { 'device': %s } }"
 
+#define QERR_DATA_SYNC_FAILED \
+    "{ 'class': 'DataSyncFailed', 'data': { 'device': %s } }"
+
 #define QERR_DEVICE_NOT_REMOVABLE \
     "{ 'class': 'DeviceNotRemovable', 'data': { 'device': %s } }"
 
@@ -142,6 +145,9 @@  QError *qobject_to_qerror(const QObject 
 #define QERR_OPEN_FILE_FAILED \
     "{ 'class': 'OpenFileFailed', 'data': { 'filename': %s } }"
 
+#define QERR_REOPEN_FILE_FAILED \
+    "{ 'class': 'ReopenFileFailed', 'data': { 'filename': %s } }"
+
 #define QERR_PROPERTY_NOT_FOUND \
     "{ 'class': 'PropertyNotFound', 'data': { 'device': %s, 'property': %s } }"
 
@@ -193,4 +199,6 @@  QError *qobject_to_qerror(const QObject 
 #define QERR_QGA_COMMAND_FAILED \
     "{ 'class': 'QgaCommandFailed', 'data': { 'message': %s } }"
 
+#define QERR_INCORRECT_COMMAND_SYNTAX \
+    "{ 'class': 'IncorrectCommandSyntax', 'data': { 'syntax': %s } }"
 #endif /* QERROR_H */