提交 50bf65ba 编写于 作者: V Vladimir Sementsov-Ogievskiy 提交者: Max Reitz

block: refactor bdrv_reopen_commit

Add bs local variable to simplify code.
Signed-off-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: NJohn Snow <jsnow@redhat.com>
Message-id: 20170628120530.31251-13-vsementsov@virtuozzo.com
Signed-off-by: NMax Reitz <mreitz@redhat.com>
上级 d1258dd0
......@@ -2982,9 +2982,11 @@ error:
void bdrv_reopen_commit(BDRVReopenState *reopen_state)
{
BlockDriver *drv;
BlockDriverState *bs;
assert(reopen_state != NULL);
drv = reopen_state->bs->drv;
bs = reopen_state->bs;
drv = bs->drv;
assert(drv != NULL);
/* 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 */
QDECREF(reopen_state->bs->explicit_options);
QDECREF(bs->explicit_options);
reopen_state->bs->explicit_options = reopen_state->explicit_options;
reopen_state->bs->open_flags = reopen_state->flags;
reopen_state->bs->read_only = !(reopen_state->flags & BDRV_O_RDWR);
bs->explicit_options = reopen_state->explicit_options;
bs->open_flags = reopen_state->flags;
bs->read_only = !(reopen_state->flags & BDRV_O_RDWR);
bdrv_refresh_limits(reopen_state->bs, NULL);
bdrv_refresh_limits(bs, NULL);
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册