Paolo Bonzini <pbonz...@redhat.com> writes: > On 10/02/2015 17:34, Markus Armbruster wrote: >> I've typed error_report("%s", error_get_pretty(ERR)) too many times >> already, and I've fixed too many instances of qerror_report_err(ERR) >> to error_report("%s", error_get_pretty(ERR)) as well. Capture the >> pattern in a convenience function. >> >> Since it's almost invariably followed by error_free(), stuff that into >> the convenience function as well. >> >> Put it to use with this Coccinelle semantic patch: > > For your "no good deed goes unpunished" record, can you prepare a Wiki > page on how to use Coccinelle? My attempts always saw it confused by > qemu/queue.h macros.
Same here, just "sometimes" instead of "always". I once tried to use Coccinelle's macro hints to unconfuse it. Frustrating failure. It's clearly a poweful tool, but working with it makes me feel like an ogre trying to use pliers. Sometimes I manage to pull a whole raft of splinters with it in one go, and then I'm one proud ogre. At other times, it completely resists my attempts to tell it what I want done. I'm at least as confused about it as Eduardo.