[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 05/13] error: define struct Error in only one pl
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 05/13] error: define struct Error in only one place |
Date: |
Fri, 18 Oct 2013 11:37:41 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9 |
Il 18/10/2013 03:11, Wenchao Xia ha scritto:
> Signed-off-by: Wenchao Xia <address@hidden>
> ---
> include/qapi/error.h | 5 ++++-
> qobject/qerror.c | 7 -------
> util/error.c | 6 ------
> 3 files changed, 4 insertions(+), 14 deletions(-)
>
> diff --git a/include/qapi/error.h b/include/qapi/error.h
> index 7d4c696..8688aaf 100644
> --- a/include/qapi/error.h
> +++ b/include/qapi/error.h
> @@ -20,7 +20,10 @@
> * A class representing internal errors within QEMU. An error has a
> ErrorClass
> * code and a human message.
> */
> -typedef struct Error Error;
> +typedef struct Error {
> + char *msg;
> + ErrorClass err_class;
> +} Error;
Please add a comment that it should be treated as an opaque type.
Paolo
>
> /**
> * Set an indirect pointer to an error given a ErrorClass value and a
> diff --git a/qobject/qerror.c b/qobject/qerror.c
> index 3aee1cf..5b487f3 100644
> --- a/qobject/qerror.c
> +++ b/qobject/qerror.c
> @@ -97,13 +97,6 @@ void qerror_report(ErrorClass eclass, const char *fmt, ...)
> }
> }
>
> -/* Evil... */
> -struct Error
> -{
> - char *msg;
> - ErrorClass err_class;
> -};
> -
> void qerror_report_err(Error *err)
> {
> QError *qerr;
> diff --git a/util/error.c b/util/error.c
> index ec0faa6..da0d221 100644
> --- a/util/error.c
> +++ b/util/error.c
> @@ -17,12 +17,6 @@
> #include "qapi-types.h"
> #include "qapi/qmp/qerror.h"
>
> -struct Error
> -{
> - char *msg;
> - ErrorClass err_class;
> -};
> -
> void error_set(Error **errp, ErrorClass err_class, const char *fmt, ...)
> {
> Error *err;
>
- [Qemu-devel] [PATCH 02/13] block: do not include monitor.h in block.c, (continued)
- [Qemu-devel] [PATCH 02/13] block: do not include monitor.h in block.c, Wenchao Xia, 2013/10/18
- [Qemu-devel] [PATCH 01/13] block: use type MonitorEvent directly, Wenchao Xia, 2013/10/18
- [Qemu-devel] [PATCH 06/13] error: remove error_printf_unless_qmp(), Wenchao Xia, 2013/10/18
- [Qemu-devel] [PATCH 07/13] error: make error_print_loc() static, Wenchao Xia, 2013/10/18
- [Qemu-devel] [PATCH 05/13] error: define struct Error in only one place, Wenchao Xia, 2013/10/18
- Re: [Qemu-devel] [PATCH 05/13] error: define struct Error in only one place,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 04/13] qapi: rename MonitorEvent to QEvent, Wenchao Xia, 2013/10/18
- [Qemu-devel] [PATCH 03/13] qapi: move MonitorEvent define, Wenchao Xia, 2013/10/18
[Qemu-devel] [PATCH 10/13] qerror: deref once in qerror_report(), Wenchao Xia, 2013/10/18