From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4pwj-00082A-Fj for qemu-devel@nongnu.org; Tue, 16 Jun 2015 08:26:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4pwg-0002Xx-4b for qemu-devel@nongnu.org; Tue, 16 Jun 2015 08:26:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4pwg-0002Xe-0K for qemu-devel@nongnu.org; Tue, 16 Jun 2015 08:26:26 -0400 From: Markus Armbruster References: <1434205258-1932-1-git-send-email-armbru@redhat.com> <1434205258-1932-5-git-send-email-armbru@redhat.com> <557EDA4A.70005@redhat.com> Date: Tue, 16 Jun 2015 14:26:23 +0200 In-Reply-To: <557EDA4A.70005@redhat.com> (Eric Blake's message of "Mon, 15 Jun 2015 07:59:38 -0600") Message-ID: <87381rhma8.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 04/11] qerror: Eliminate QERR_DEVICE_NOT_FOUND List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: kwolf@redhat.com, lcapitulino@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com, mdroth@linux.vnet.ibm.com Eric Blake writes: > On 06/13/2015 08:20 AM, Markus Armbruster wrote: >> Error classes other than ERROR_CLASS_GENERIC_ERROR should not be used >> in new code. Hiding them in QERR_ macros makes new uses hard to spot. >> Fortunately, there's just one such macro left. Eliminate it with this >> coccinelle semantic patch: >> >> @@ >> expression EP, E; >> @@ >> -error_set(EP, QERR_DEVICE_NOT_FOUND, E) >> +error_set(EP, ERROR_CLASS_DEVICE_NOT_FOUND, "Device '%s' not found", E) >> >> Signed-off-by: Markus Armbruster >> --- >> backends/rng-egd.c | 3 ++- >> blockdev-nbd.c | 3 ++- >> blockdev.c | 33 ++++++++++++++++++++++----------- >> hmp.c | 6 ++++-- >> include/qapi/qmp/qerror.h | 3 --- >> net/net.c | 6 ++++-- >> qdev-monitor.c | 6 ++++-- >> qmp.c | 12 ++++++++---- >> qom/object.c | 6 ++++-- >> ui/input.c | 3 ++- >> 10 files changed, 52 insertions(+), 29 deletions(-) > > Plain transformation would be closer to a 1:1 insertion/deletion count. > The larger insertion count is due to reflowing long lines after the > transformation. Does coccinelle do that for you, or do you have to > touch things up manually? It does, and most of the time it's a relief. > But I'm okay with the result. > > Reviewed-by: Eric Blake Thanks!