[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 14/14] block/qcow2: refactor qcow2_update_options_prepare
From: |
Alberto Garcia |
Subject: |
Re: [PATCH v5 14/14] block/qcow2: refactor qcow2_update_options_prepare error paths |
Date: |
Mon, 11 Jan 2021 17:08:27 +0100 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Sat 09 Jan 2021 01:58:11 PM CET, Vladimir Sementsov-Ogievskiy wrote:
> Keep setting ret close to setting errp and don't merge different error
> paths into one. This way it's more obvious that we don't return
> error without setting errp.
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
I get the idea, but I feel the code is getting innecessarily verbose.
One alternative would be to get rid of all -EINVAL inside the switch
block, take advantage of the existing local_err and follow the block
with:
if (local_err) {
error_propagate(errp, local_err);
ret = -EINVAL;
goto fail;
}
But otherwise your solution is correct, so you can keep it if you
prefer:
Reviewed-by: Alberto Garcia <berto@igalia.com>
Berto
- [PATCH v5 05/14] block: drop extra error propagation for bdrv_set_backing_hd, (continued)
- [PATCH v5 05/14] block: drop extra error propagation for bdrv_set_backing_hd, Vladimir Sementsov-Ogievskiy, 2021/01/09
- [PATCH v5 04/14] blockdev: fix drive_backup_prepare() missed error, Vladimir Sementsov-Ogievskiy, 2021/01/09
- [PATCH v5 06/14] block/mirror: drop extra error propagation in commit_active_start(), Vladimir Sementsov-Ogievskiy, 2021/01/09
- [PATCH v5 07/14] blockjob: return status from block_job_set_speed(), Vladimir Sementsov-Ogievskiy, 2021/01/09
- [PATCH v5 08/14] block/qcow2: qcow2_get_specific_info(): drop error propagation, Vladimir Sementsov-Ogievskiy, 2021/01/09
- [PATCH v5 09/14] block/qcow2-bitmap: improve qcow2_load_dirty_bitmaps() interface, Vladimir Sementsov-Ogievskiy, 2021/01/09
- [PATCH v5 11/14] block/qcow2: read_cache_sizes: return status value, Vladimir Sementsov-Ogievskiy, 2021/01/09
- [PATCH v5 10/14] block/qcow2-bitmap: return status from qcow2_store_persistent_dirty_bitmaps, Vladimir Sementsov-Ogievskiy, 2021/01/09
- [PATCH v5 12/14] block/qcow2: simplify qcow2_co_invalidate_cache(), Vladimir Sementsov-Ogievskiy, 2021/01/09
- [PATCH v5 14/14] block/qcow2: refactor qcow2_update_options_prepare error paths, Vladimir Sementsov-Ogievskiy, 2021/01/09
- Re: [PATCH v5 14/14] block/qcow2: refactor qcow2_update_options_prepare error paths,
Alberto Garcia <=
- [PATCH v5 13/14] block/qed: bdrv_qed_do_open: deal with errp, Vladimir Sementsov-Ogievskiy, 2021/01/09