qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 37/44] error: Reduce unnecessary error propagation


From: Markus Armbruster
Subject: Re: [PATCH v2 37/44] error: Reduce unnecessary error propagation
Date: Fri, 03 Jul 2020 09:09:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Eric Blake <eblake@redhat.com> writes:

> On 7/2/20 10:49 AM, Markus Armbruster wrote:
>> When all we do with an Error we receive into a local variable is
>> propagating to somewhere else, we can just as well receive it there
>> right away, even when we need to keep error_propagate() for other
>> error paths.
>>
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>
>> +++ b/block/replication.c
>> @@ -85,7 +85,6 @@ static int replication_open(BlockDriverState *bs, QDict 
>> *options,
>>   {
>>       int ret;
>>       BDRVReplicationState *s = bs->opaque;
>> -    Error *local_err = NULL;
>>       QemuOpts *opts = NULL;
>>       const char *mode;
>>       const char *top_id;
>> @@ -99,7 +98,7 @@ static int replication_open(BlockDriverState *bs, QDict 
>> *options,
>>         ret = -EINVAL;
>>       opts = qemu_opts_create(&replication_runtime_opts, NULL, 0, 
>> &error_abort);
>> -    if (!qemu_opts_absorb_qdict(opts, options, &local_err)) {
>> +    if (!qemu_opts_absorb_qdict(opts, options, errp)) {
>>           goto fail;
>>       }
>
> Does this one belong in 36/44, given that removal of 'local_err' is
> evidence that no other error path needed it?
>
> Either way, it belongs in the series, and the result of the two
> patches together is fine.
>
> Reviewed-by: Eric Blake <eblake@redhat.com>

Actually, this hunk needs to go before PATCH 33 to keep it correct.
I'll find out how to best reshuffle hunks.  The end result will be the
same.

Thanks!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]