Patchwork [RFC,3/4] qerror: new errors for live block commit, QERR_TOP_NOT_FOUND

login
register
mail settings
Submitter Jeff Cody
Date July 31, 2012, 5:16 a.m.
Message ID <6fa5167365c66d4c450000e86c34b77db0bd2288.1343710713.git.jcody@redhat.com>
Download mbox | patch
Permalink /patch/174143/
State New
Headers show

Comments

Jeff Cody - July 31, 2012, 5:16 a.m.
Signed-off-by: Jeff Cody <jcody@redhat.com>
---
 qerror.c |    4 ++++
 qerror.h |    3 +++
 2 files changed, 7 insertions(+)
Eric Blake - July 31, 2012, 6:35 p.m.
On 07/30/2012 11:16 PM, Jeff Cody wrote:
> Signed-off-by: Jeff Cody <jcody@redhat.com>
> ---
>  qerror.c |    4 ++++
>  qerror.h |    3 +++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/qerror.c b/qerror.c
> index 25c2733..69a59ab 100644
> --- a/qerror.c
> +++ b/qerror.c
> @@ -307,6 +307,10 @@ static const QErrorStringTable qerror_table[] = {
>          .desc      = "Too many open files",
>      },
>      {
> +        .error_fmt = QERR_TOP_NOT_FOUND,
> +        .desc      = "Top '%(top)' not found",
> +    },
> +    {

This conflicts with the series to simplify error handling; if we want
both series, I'd suggest rebasing this one to use the simpler handling.

Patch

diff --git a/qerror.c b/qerror.c
index 25c2733..69a59ab 100644
--- a/qerror.c
+++ b/qerror.c
@@ -307,6 +307,10 @@  static const QErrorStringTable qerror_table[] = {
         .desc      = "Too many open files",
     },
     {
+        .error_fmt = QERR_TOP_NOT_FOUND,
+        .desc      = "Top '%(top)' not found",
+    },
+    {
         .error_fmt = QERR_UNDEFINED_ERROR,
         .desc      = "An undefined error has occurred",
     },
diff --git a/qerror.h b/qerror.h
index 0f9f303..931c703 100644
--- a/qerror.h
+++ b/qerror.h
@@ -251,6 +251,9 @@  QError *qobject_to_qerror(const QObject *obj);
 #define QERR_TOO_MANY_FILES \
     "{ 'class': 'TooManyFiles', 'data': {} }"
 
+#define QERR_TOP_NOT_FOUND \
+    "{ 'class': 'TopNotFound', 'data': { 'top': %s } }"
+
 #define QERR_UNDEFINED_ERROR \
     "{ 'class': 'UndefinedError', 'data': {} }"