[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 11/24] error: Use error_reportf_err() where i
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v3 11/24] error: Use error_reportf_err() where it makes obvious sense |
Date: |
Fri, 18 Dec 2015 17:22:53 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
Eric Blake <address@hidden> writes:
> On 12/18/2015 08:35 AM, Markus Armbruster wrote:
>> Done with this Coccinelle semantic patch
>>
>> @@
>> expression FMT, E, S;
>> expression list ARGS;
>> @@
>> - error_report(FMT, ARGS, error_get_pretty(E));
>> + error_reportf_err(E, FMT/*@@@*/, ARGS);
>> (
>> - error_free(E);
>> |
>> exit(S);
>> |
>> abort();
>> )
>>
>> followed by a replace of '%s"/*@@@*/' by '"' and some line rewrapping,
>> because I can't figure out how to make Coccinelle transform strings.
>>
>> We now use the error whole instead of just its message obtained with
>> error_get_pretty(). This avoids suppressing its hint (see commit
>> 50b7b00), but I can't see how the errors touched in this commit could
>> come with hints.
>>
>> Signed-off-by: Markus Armbruster <address@hidden>
>> ---
>
>> +++ b/arch_init.c
>> @@ -258,9 +258,7 @@ void do_acpitable_option(const QemuOpts *opts)
>>
>> acpi_table_add(opts, &err);
>> if (err) {
>> - error_report("Wrong acpi table provided: %s",
>> - error_get_pretty(err));
>> - error_free(err);
>> + error_reportf_err(err, "Wrong acpi table provided: ");
>
> Bikeshedding: should error_reportf_err() automatically add the trailing
> ": " to the prefix, instead of having every caller express it? Would
> affect 10/24 as well. But I can't see a strong reason to add the churn
> it would cause for a respin, so I won't insist.
I decided not to add ": " automatically, to make the prefix-ness of the
argument a bit more obvious.
> Reviewed-by: Eric Blake <address@hidden>
Thanks!
- [Qemu-devel] [PATCH v3 03/24] error: Use error_report_err() instead of monitor_printf(), (continued)
- [Qemu-devel] [PATCH v3 03/24] error: Use error_report_err() instead of monitor_printf(), Markus Armbruster, 2015/12/18
- [Qemu-devel] [PATCH v3 16/24] error: Strip trailing '\n' from error string arguments (again), Markus Armbruster, 2015/12/18
- [Qemu-devel] [PATCH v3 14/24] migration: Use error_reportf_err() instead of monitor_printf(), Markus Armbruster, 2015/12/18
- [Qemu-devel] [PATCH v3 22/24] hw/s390x: Rename local variables Error *l_err to just err, Markus Armbruster, 2015/12/18
- [Qemu-devel] [PATCH v3 05/24] error: Improve documentation, Markus Armbruster, 2015/12/18
- [Qemu-devel] [PATCH v3 24/24] error: Consistently name Error * objects err, and not errp, Markus Armbruster, 2015/12/18
- [Qemu-devel] [PATCH v3 11/24] error: Use error_reportf_err() where it makes obvious sense, Markus Armbruster, 2015/12/18
- [Qemu-devel] [PATCH v3 21/24] error: Clean up errors with embedded newlines (again), Markus Armbruster, 2015/12/18
- [Qemu-devel] [PATCH v3 20/24] vhdx: Fix "log that needs to be replayed" error message, Markus Armbruster, 2015/12/18
- [Qemu-devel] [PATCH v3 23/24] s390/sclp: Simplify control flow in sclp_realize(), Markus Armbruster, 2015/12/18