Patchwork [RFC,2/7] Qemu: Error classes for file reopen and data sync failure

login
register
mail settings
Submitter Supriya Kannery
Date Feb. 1, 2012, 3:06 a.m.
Message ID <20120201030628.2990.42721.sendpatchset@skannery.in.ibm.com>
Download mbox | patch
Permalink /patch/138891/
State New
Headers show

Comments

Supriya Kannery - Feb. 1, 2012, 3:06 a.m.
New error classes defined for file reopen failure and data
sync error

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

---
 qerror.c |    8 ++++++++
 qerror.h |    6 ++++++
 2 files changed, 14 insertions(+)
Stefan Hajnoczi - Feb. 7, 2012, 7:56 a.m.
On Wed, Feb 01, 2012 at 08:36:28AM +0530, Supriya Kannery wrote:
> Index: qemu/qerror.c
> ===================================================================
> --- qemu.orig/qerror.c
> +++ qemu/qerror.c
> @@ -108,6 +108,14 @@ static const QErrorStringTable qerror_ta
>          .desc      = "Device '%(device)' has multiple child busses",
>      },
>      {
> +        .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)'",
> +    },

The comment in qerror.c says:

"Please keep the entries in alphabetical order.
Use scripts/check-qerror.sh to check."

> +    {
>          .error_fmt = QERR_DEVICE_NO_BUS,
>          .desc      = "Device '%(device)' has no child bus",
>      },
> Index: qemu/qerror.h
> ===================================================================
> --- qemu.orig/qerror.h
> +++ qemu/qerror.h
> @@ -117,6 +117,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 } }"
> +

Same here:

/*
 * QError class list
 * Please keep the definitions in alphabetical order.
 * Use scripts/check-qerror.sh to check.
 */
Supriya Kannery - Feb. 13, 2012, 1:13 p.m.
On 02/07/2012 01:26 PM, Stefan Hajnoczi wrote:
> On Wed, Feb 01, 2012 at 08:36:28AM +0530, Supriya Kannery wrote:
>> Index: qemu/qerror.c
>> ===================================================================
>> --- qemu.orig/qerror.c
>> +++ qemu/qerror.c
>> @@ -108,6 +108,14 @@ static const QErrorStringTable qerror_ta
>>           .desc      = "Device '%(device)' has multiple child busses",
>>       },
>>       {
>> +        .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)'",
>> +    },
>
> The comment in qerror.c says:
>
> "Please keep the entries in alphabetical order.
> Use scripts/check-qerror.sh to check."
>

ok

>> +    {
>>           .error_fmt = QERR_DEVICE_NO_BUS,
>>           .desc      = "Device '%(device)' has no child bus",
>>       },
>> Index: qemu/qerror.h
>> ===================================================================
>> --- qemu.orig/qerror.h
>> +++ qemu/qerror.h
>> @@ -117,6 +117,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 } }"
>> +
>
> Same here:
>
> /*
>   * QError class list
>   * Please keep the definitions in alphabetical order.
>   * Use scripts/check-qerror.sh to check.
>   */
>

ok

Patch

Index: qemu/qerror.c
===================================================================
--- qemu.orig/qerror.c
+++ qemu/qerror.c
@@ -108,6 +108,14 @@  static const QErrorStringTable qerror_ta
         .desc      = "Device '%(device)' has multiple child busses",
     },
     {
+        .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",
     },
Index: qemu/qerror.h
===================================================================
--- qemu.orig/qerror.h
+++ qemu/qerror.h
@@ -117,6 +117,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 } }"
 
@@ -180,6 +183,9 @@  QError *qobject_to_qerror(const QObject 
 #define QERR_PERMISSION_DENIED \
     "{ 'class': 'PermissionDenied', 'data': {} }"
 
+#define QERR_REOPEN_FILE_FAILED \
+    "{ 'class': 'ReopenFileFailed', 'data': { 'filename': %s } }"
+
 #define QERR_PROPERTY_NOT_FOUND \
     "{ 'class': 'PropertyNotFound', 'data': { 'device': %s, 'property': %s } }"