From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoFFN-0004OK-CS for qemu-devel@nongnu.org; Mon, 09 Jul 2012 10:47:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SoFFF-0002vF-VM for qemu-devel@nongnu.org; Mon, 09 Jul 2012 10:47:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9853) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SoFFF-0002uF-N7 for qemu-devel@nongnu.org; Mon, 09 Jul 2012 10:47:25 -0400 Message-ID: <4FFAEEF5.7000305@redhat.com> Date: Mon, 09 Jul 2012 16:47:17 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <20120615204648.9853.1225.sendpatchset@skannery.in.ibm.com> <20120615204716.9853.24941.sendpatchset@skannery.in.ibm.com> In-Reply-To: <20120615204716.9853.24941.sendpatchset@skannery.in.ibm.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [v1 Patch 2/10]Qemu: Error classes for hostcache setting and data sync failures List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Supriya Kannery Cc: Shrinidhi Joshi , Stefan Hajnoczi , Jeff Cody , qemu-devel@nongnu.org, Luiz Capitulino , Christoph Hellwig 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 > > --- > 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