[01/18] qerror: introduce QERR_GENERIC_ERROR

Submitted by Pavel Hrdina on Aug. 15, 2012, 7:41 a.m.

Details

Message ID 1a792397f896fe2c5106eb55e58d0e3c8a3032c3.1345016001.git.phrdina@redhat.com
State New
Headers show

Commit Message

Pavel Hrdina Aug. 15, 2012, 7:41 a.m.
Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
---
 qerror.h | 3 +++
 1 file changed, 3 insertions(+)

Comments

Luiz Capitulino Aug. 30, 2012, 12:11 p.m.
On Wed, 15 Aug 2012 09:41:42 +0200
Pavel Hrdina <phrdina@redhat.com> wrote:

> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
> ---
>  qerror.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/qerror.h b/qerror.h
> index d0a76a4..7e0bae7 100644
> --- a/qerror.h
> +++ b/qerror.h
> @@ -120,6 +120,9 @@ void assert_no_error(Error *err);
>  #define QERR_FEATURE_DISABLED \
>      ERROR_CLASS_GENERIC_ERROR, "The feature '%s' is not enabled"
>  
> +#define QERR_GENERIC_ERROR \
> +    ERROR_CLASS_GENERIC_ERROR, "An (Errno %d) error has occurred"
> +

You should use error_setg() instead:

 http://lists.gnu.org/archive/html/qemu-devel/2012-08/msg04980.html

There usage examples in the series introducing it. It would be better
to wait for it to be merged before you use it though, as it's always
possible for people to ask for changes.

>  #define QERR_INVALID_BLOCK_FORMAT \
>      ERROR_CLASS_GENERIC_ERROR, "Invalid block format '%s'"
>
Pavel Hrdina Sept. 6, 2012, 8:34 a.m.
On 08/30/2012 02:11 PM, Luiz Capitulino wrote:
> On Wed, 15 Aug 2012 09:41:42 +0200
> Pavel Hrdina <phrdina@redhat.com> wrote:
>
>> Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
>> ---
>>   qerror.h | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/qerror.h b/qerror.h
>> index d0a76a4..7e0bae7 100644
>> --- a/qerror.h
>> +++ b/qerror.h
>> @@ -120,6 +120,9 @@ void assert_no_error(Error *err);
>>   #define QERR_FEATURE_DISABLED \
>>       ERROR_CLASS_GENERIC_ERROR, "The feature '%s' is not enabled"
>>   
>> +#define QERR_GENERIC_ERROR \
>> +    ERROR_CLASS_GENERIC_ERROR, "An (Errno %d) error has occurred"
>> +
> You should use error_setg() instead:

I'll fix it for whole patch-series.
>
>   http://lists.gnu.org/archive/html/qemu-devel/2012-08/msg04980.html
>
> There usage examples in the series introducing it. It would be better
> to wait for it to be merged before you use it though, as it's always
> possible for people to ask for changes.
>
>>   #define QERR_INVALID_BLOCK_FORMAT \
>>       ERROR_CLASS_GENERIC_ERROR, "Invalid block format '%s'"
>>

Patch hide | download patch | download mbox

diff --git a/qerror.h b/qerror.h
index d0a76a4..7e0bae7 100644
--- a/qerror.h
+++ b/qerror.h
@@ -120,6 +120,9 @@  void assert_no_error(Error *err);
 #define QERR_FEATURE_DISABLED \
     ERROR_CLASS_GENERIC_ERROR, "The feature '%s' is not enabled"
 
+#define QERR_GENERIC_ERROR \
+    ERROR_CLASS_GENERIC_ERROR, "An (Errno %d) error has occurred"
+
 #define QERR_INVALID_BLOCK_FORMAT \
     ERROR_CLASS_GENERIC_ERROR, "Invalid block format '%s'"