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: Kevin Wolf
Subject: Re: [Qemu-devel] [v1 Patch 2/10]Qemu: Error classes for hostcache setting and data sync failures
Date: Mon, 09 Jul 2012 16:47:17 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0

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



reply via email to

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