[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 09/14] block/qcow2: qcow2_get_specific_info(): drop error pro
From: |
Alberto Garcia |
Subject: |
Re: [PATCH 09/14] block/qcow2: qcow2_get_specific_info(): drop error propagation |
Date: |
Thu, 17 Sep 2020 18:32:56 +0200 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
On Wed 09 Sep 2020 08:59:25 PM CEST, Vladimir Sementsov-Ogievskiy
<vsementsov@virtuozzo.com> wrote:
> + * On success return true with bm_list set (probably to NULL, if no bitmaps),
" probably " ? :-)
> + * on failure return false with errp set.
> */
> -Qcow2BitmapInfoList *qcow2_get_bitmap_info_list(BlockDriverState *bs,
> - Error **errp)
> +bool qcow2_get_bitmap_info_list(BlockDriverState *bs,
> + Qcow2BitmapInfoList **info_list, Error
> **errp)
> {
> BDRVQcow2State *s = bs->opaque;
> Qcow2BitmapList *bm_list;
> Qcow2Bitmap *bm;
> - Qcow2BitmapInfoList *list = NULL;
> - Qcow2BitmapInfoList **plist = &list;
So here 'list' points at NULL and 'plist' at &list.
> - *plist = obj;
> - plist = &obj->next;
In the original code 'plist' is updated when you add a new element, so
it always points at the end of the list. But 'list' is unchanged and it
still points at the first element.
So the caller receives a pointer to the first element.
> + *info_list = obj;
> + info_list = &obj->next;
But in the new code there is only one variable (passed by the caller),
which always points at the end of the list.
Berto
- Re: [PATCH 06/14] block/mirror: drop extra error propagation in commit_active_start(), (continued)
- [PATCH 08/14] blockjob: return status from block_job_set_speed(), Vladimir Sementsov-Ogievskiy, 2020/09/09
- [PATCH 12/14] block/qcow2: read_cache_sizes: return status value, Vladimir Sementsov-Ogievskiy, 2020/09/09
- [PATCH 09/14] block/qcow2: qcow2_get_specific_info(): drop error propagation, Vladimir Sementsov-Ogievskiy, 2020/09/09
- [PATCH 13/14] block/qcow2: qcow2_do_open: deal with errp, Vladimir Sementsov-Ogievskiy, 2020/09/09
- [PATCH 14/14] block/qed: bdrv_qed_do_open: deal with errp, Vladimir Sementsov-Ogievskiy, 2020/09/09