Patchwork [V3,2/3] Error classes for file reopen and device insertion

login
register
mail settings
Submitter Supriya Kannery
Date June 17, 2011, 4:37 p.m.
Message ID <20110617163748.2933.72478.sendpatchset@skannery>
Download mbox | patch
Permalink /patch/100837/
State New
Headers show

Comments

Supriya Kannery - June 17, 2011, 4:37 p.m.
New error classes defined for cases where device not inserted
and file reopen failed.

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

---
 qerror.c |    8 ++++++++
 qerror.h |    6 ++++++
 2 files changed, 14 insertions(+)
Kevin Wolf - June 20, 2011, 2:23 p.m.
Am 17.06.2011 18:37, schrieb Supriya Kannery:
> New error classes defined for cases where device not inserted
> and file reopen failed.
> 
> Signed-off-by: Supriya Kannery <supriyak@in.ibm.com>

This one has tabs, too.

Kevin

Patch

Index: qemu/qerror.c
===================================================================
--- qemu.orig/qerror.c
+++ qemu/qerror.c
@@ -96,6 +96,14 @@  static const QErrorStringTable qerror_ta
         .error_fmt = QERR_DEVICE_NOT_REMOVABLE,
         .desc      = "Device '%(device)' is not removable",
     },
+	{
+		.error_fmt = QERR_DEVICE_NOT_INSERTED,
+		.desc      = "Device '%(device)' has not been inserted",
+	},
+	{
+		.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
@@ -85,6 +85,9 @@  QError *qobject_to_qerror(const QObject 
 #define QERR_DEVICE_NOT_FOUND \
     "{ 'class': 'DeviceNotFound', 'data': { 'device': %s } }"
 
+#define QERR_DEVICE_NOT_INSERTED \
+	"{ 'class': 'DeviceNotInserted', 'data': { 'device': %s } }"
+
 #define QERR_DEVICE_NOT_REMOVABLE \
     "{ 'class': 'DeviceNotRemovable', 'data': { 'device': %s } }"
 
@@ -139,6 +142,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 } }"