Skip to content

Commit

Permalink
block/io: bdrv_refresh_limits(): use ERRP_GUARD
Browse files Browse the repository at this point in the history
This simplifies following commit.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20201203222713.13507-3-vsementsov@virtuozzo.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
  • Loading branch information
Vladimir Sementsov-Ogievskiy authored and kevmw committed Dec 11, 2020
1 parent 9b100af commit 3398561
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions block/io.c
Expand Up @@ -135,10 +135,10 @@ static void bdrv_merge_limits(BlockLimits *dst, const BlockLimits *src)

void bdrv_refresh_limits(BlockDriverState *bs, Error **errp)
{
ERRP_GUARD();
BlockDriver *drv = bs->drv;
BdrvChild *c;
bool have_limits;
Error *local_err = NULL;

memset(&bs->bl, 0, sizeof(bs->bl));

Expand All @@ -156,9 +156,8 @@ void bdrv_refresh_limits(BlockDriverState *bs, Error **errp)
QLIST_FOREACH(c, &bs->children, next) {
if (c->role & (BDRV_CHILD_DATA | BDRV_CHILD_FILTERED | BDRV_CHILD_COW))
{
bdrv_refresh_limits(c->bs, &local_err);
if (local_err) {
error_propagate(errp, local_err);
bdrv_refresh_limits(c->bs, errp);
if (*errp) {
return;
}
bdrv_merge_limits(&bs->bl, &c->bs->bl);
Expand Down

0 comments on commit 3398561

Please sign in to comment.