qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [v1 Patch 2/10]Qemu: Error classes for hostcache settin


From: Supriya Kannery
Subject: Re: [Qemu-devel] [v1 Patch 2/10]Qemu: Error classes for hostcache setting and data sync failures
Date: Sun, 29 Jul 2012 12:28:15 +0530
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.20) Gecko/20110817 Fedora/3.1.12-1.fc14 Thunderbird/3.1.12

On 07/09/2012 08:17 PM, Kevin Wolf wrote:
Am 15.06.2012 22:47, schrieb Supriya Kannery:
New error classes defined for hostcache setting and data
sync error

Signed-off-by: Supriya Kannery<address@hidden>

---
  qerror.c |    8 ++++++++
  qerror.h |    6 ++++++
  2 files changed, 14 insertions(+)

Index: qemu/qerror.c
===================================================================
--- qemu.orig/qerror.c
+++ qemu/qerror.c
@@ -80,6 +80,10 @@ static const QErrorStringTable qerror_ta
          .desc      = "The command %(name) has not been found",
      },
      {
+        .error_fmt = QERR_DATA_SYNC_FAILED,
+        .desc      = "Syncing of data failed for device '%(device)'",
+    },
+    {
          .error_fmt = QERR_DEVICE_ENCRYPTED,
          .desc      = "Device '%(device)' is encrypted",
      },
@@ -152,6 +156,10 @@ static const QErrorStringTable qerror_ta
          .desc      = "The feature '%(name)' is not enabled",
      },
      {
+        .error_fmt = QERR_HOSTCACHE_NOT_CHANGED,
+        .desc      = "Could not change hostcache setting for '%(device)'",
+    },
+    {
          .error_fmt = QERR_INVALID_BLOCK_FORMAT,
          .desc      = "Invalid block format '%(name)'",
      },
Index: qemu/qerror.h
===================================================================
--- qemu.orig/qerror.h
+++ qemu/qerror.h
@@ -82,6 +82,9 @@ QError *qobject_to_qerror(const QObject
  #define QERR_COMMAND_NOT_FOUND \
      "{ 'class': 'CommandNotFound', 'data': { 'name': %s } }"

+#define QERR_DATA_SYNC_FAILED \
+    "{ 'class': 'DataSyncFailed', 'data': { 'device': %s } }"
+
  #define QERR_DEVICE_ENCRYPTED \
      "{ 'class': 'DeviceEncrypted', 'data': { 'device': %s, 'filename': %s } }"

@@ -136,6 +139,9 @@ QError *qobject_to_qerror(const QObject
  #define QERR_FEATURE_DISABLED \
      "{ 'class': 'FeatureDisabled', 'data': { 'name': %s } }"

+#define QERR_HOSTCACHE_NOT_CHANGED \
+    "{ 'class': 'HostcacheNotChanged', 'data': { 'device': %s } }"
+
  #define QERR_INVALID_BLOCK_FORMAT \
      "{ 'class': 'InvalidBlockFormat', 'data': { 'name': %s } }"

In the light of the recent error handling discussion: Do we really need
two separate errors? Can we just reuse an existing one? Just
QERR_IO_ERROR could be good enough.

Kevin


Yes, will use QERR_IO_ERROR instead of these two new errors.

-thanks, Supriya




reply via email to

[Prev in Thread] Current Thread [Next in Thread]