block: refactor bdrv_reopen_commit
Add bs local variable to simplify code. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20170628120530.31251-13-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
This commit is contained in:
parent
d1258dd0c8
commit
50bf65bab6
14
block.c
14
block.c
|
@ -2982,9 +2982,11 @@ error:
|
||||||
void bdrv_reopen_commit(BDRVReopenState *reopen_state)
|
void bdrv_reopen_commit(BDRVReopenState *reopen_state)
|
||||||
{
|
{
|
||||||
BlockDriver *drv;
|
BlockDriver *drv;
|
||||||
|
BlockDriverState *bs;
|
||||||
|
|
||||||
assert(reopen_state != NULL);
|
assert(reopen_state != NULL);
|
||||||
drv = reopen_state->bs->drv;
|
bs = reopen_state->bs;
|
||||||
|
drv = bs->drv;
|
||||||
assert(drv != NULL);
|
assert(drv != NULL);
|
||||||
|
|
||||||
/* If there are any driver level actions to take */
|
/* If there are any driver level actions to take */
|
||||||
|
@ -2993,13 +2995,13 @@ void bdrv_reopen_commit(BDRVReopenState *reopen_state)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set BDS specific flags now */
|
/* set BDS specific flags now */
|
||||||
QDECREF(reopen_state->bs->explicit_options);
|
QDECREF(bs->explicit_options);
|
||||||
|
|
||||||
reopen_state->bs->explicit_options = reopen_state->explicit_options;
|
bs->explicit_options = reopen_state->explicit_options;
|
||||||
reopen_state->bs->open_flags = reopen_state->flags;
|
bs->open_flags = reopen_state->flags;
|
||||||
reopen_state->bs->read_only = !(reopen_state->flags & BDRV_O_RDWR);
|
bs->read_only = !(reopen_state->flags & BDRV_O_RDWR);
|
||||||
|
|
||||||
bdrv_refresh_limits(reopen_state->bs, NULL);
|
bdrv_refresh_limits(bs, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue