[GEDI] [PATCH v4 05/31] scripts: add script to fix error_append_hint/error_prepend usage

Eric Blake eblake at redhat.com
Tue Oct 1 17:08:50 UTC 2019


On 10/1/19 11:50 AM, Eric Blake wrote:
> On 10/1/19 10:52 AM, Vladimir Sementsov-Ogievskiy wrote:
>> error_append_hint and error_prepend will not work, if errp ==
>> &fatal_error, as program will exit before error_append_hint or
>> error_prepend call. Fix this by use of special macro
>> ERRP_AUTO_PROPAGATE.
>>
>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov at virtuozzo.com>
>> ---
>>
> 
>> +++ b/scripts/coccinelle/fix-error-add-info.cocci
>> @@ -0,0 +1,28 @@
>> + at rule0@
>> +// Add invocation to errp-functions
>> +identifier fn;

Adding:

symbol errp;

to this section appears to be the correct solution for...

>> +@@
>> +
>> + fn(..., Error **errp, ...)
>> + {
> 
> When running this script, I get lots of warnings:
> 
> init_defs_builtins: /usr/lib64/coccinelle/standard.h
> warning: line 6: should errp be a metavariable?
> warning: line 11: should errp be a metavariable?
> warning: line 13: should errp be a metavariable?
> HANDLING: include/block/nbd.h
> 

silencing these warnings.  But it's still not enough to fix the issue 
I'm pointing out in patch 23 being incomplete.


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org


More information about the integration mailing list