[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 04/11] qerror: Eliminate QERR_DEVICE_NOT_FOUND
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH 04/11] qerror: Eliminate QERR_DEVICE_NOT_FOUND |
Date: |
Tue, 16 Jun 2015 14:26:23 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Eric Blake <address@hidden> 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 <address@hidden>
>> ---
>> 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 <address@hidden>
Thanks!
- [Qemu-devel] [PATCH 00/11] Sprint to the finish: purge QError, Markus Armbruster, 2015/06/13
- [Qemu-devel] [PATCH 02/11] vl: Avoid qerror_report() outside QMP command handlers, Markus Armbruster, 2015/06/13
- [Qemu-devel] [PATCH 03/11] vl: Use error_report() for --display errors, Markus Armbruster, 2015/06/13
- [Qemu-devel] [PATCH 06/11] tpm: Avoid qerror_report() outside QMP command handlers, Markus Armbruster, 2015/06/13
- [Qemu-devel] [PATCH 04/11] qerror: Eliminate QERR_DEVICE_NOT_FOUND, Markus Armbruster, 2015/06/13
- Re: [Qemu-devel] [PATCH 04/11] qerror: Eliminate QERR_DEVICE_NOT_FOUND, Eric Blake, 2015/06/15
- Re: [Qemu-devel] [PATCH 04/11] qerror: Eliminate QERR_DEVICE_NOT_FOUND,
Markus Armbruster <=
- Re: [Qemu-devel] [PATCH 04/11] qerror: Eliminate QERR_DEVICE_NOT_FOUND, Stefan Hajnoczi, 2015/06/15
- Re: [Qemu-devel] [PATCH 04/11] qerror: Eliminate QERR_DEVICE_NOT_FOUND, Luiz Capitulino, 2015/06/15
- Re: [Qemu-devel] [PATCH 04/11] qerror: Eliminate QERR_DEVICE_NOT_FOUND, Peter Maydell, 2015/06/15
- Re: [Qemu-devel] [PATCH 04/11] qerror: Eliminate QERR_DEVICE_NOT_FOUND, Markus Armbruster, 2015/06/16
[Qemu-devel] [PATCH 08/11] qerror: Finally unused, clean up, Markus Armbruster, 2015/06/13
[Qemu-devel] [PATCH 11/11] Include monitor/monitor.h exactly where needed, Markus Armbruster, 2015/06/13