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>
This commit is contained in:
parent
9b100af30f
commit
33985614bd
@ -135,10 +135,10 @@ static void bdrv_merge_limits(BlockLimits *dst, const BlockLimits *src)
|
|||||||
|
|
||||||
void bdrv_refresh_limits(BlockDriverState *bs, Error **errp)
|
void bdrv_refresh_limits(BlockDriverState *bs, Error **errp)
|
||||||
{
|
{
|
||||||
|
ERRP_GUARD();
|
||||||
BlockDriver *drv = bs->drv;
|
BlockDriver *drv = bs->drv;
|
||||||
BdrvChild *c;
|
BdrvChild *c;
|
||||||
bool have_limits;
|
bool have_limits;
|
||||||
Error *local_err = NULL;
|
|
||||||
|
|
||||||
memset(&bs->bl, 0, sizeof(bs->bl));
|
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) {
|
QLIST_FOREACH(c, &bs->children, next) {
|
||||||
if (c->role & (BDRV_CHILD_DATA | BDRV_CHILD_FILTERED | BDRV_CHILD_COW))
|
if (c->role & (BDRV_CHILD_DATA | BDRV_CHILD_FILTERED | BDRV_CHILD_COW))
|
||||||
{
|
{
|
||||||
bdrv_refresh_limits(c->bs, &local_err);
|
bdrv_refresh_limits(c->bs, errp);
|
||||||
if (local_err) {
|
if (*errp) {
|
||||||
error_propagate(errp, local_err);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
bdrv_merge_limits(&bs->bl, &c->bs->bl);
|
bdrv_merge_limits(&bs->bl, &c->bs->bl);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user