diff options
author | Vladimir Sementsov-Ogievskiy | 2020-12-03 23:27:11 +0100 |
---|---|---|
committer | Kevin Wolf | 2020-12-11 17:52:40 +0100 |
commit | 33985614bdbb302049e3dbc13580404b04cc4131 (patch) | |
tree | 95c7f8f0bf8bac8a16d6b45d38f73f724a78488c | |
parent | block/file-posix: fix workaround in raw_do_pwrite_zeroes() (diff) | |
download | qemu-33985614bdbb302049e3dbc13580404b04cc4131.tar.gz qemu-33985614bdbb302049e3dbc13580404b04cc4131.tar.xz qemu-33985614bdbb302049e3dbc13580404b04cc4131.zip |
block/io: bdrv_refresh_limits(): use ERRP_GUARD
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>
-rw-r--r-- | block/io.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/block/io.c b/block/io.c index ec5e152bb7..3e91074c9f 100644 --- a/block/io.c +++ b/block/io.c @@ -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)); @@ -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); |