summaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2017-06-28 15:05:12 +0300
committerMax Reitz <mreitz@redhat.com>2017-07-11 17:44:58 +0200
commit50bf65bab69aa6d01f759732927fbbf1c8abfe15 (patch)
tree6b644c6e0011bef833b64294b9fe0204731db0d4 /block.c
parentd1258dd0c87d27faa5d25f8d604e030dd2a5d3d7 (diff)
downloadqemu-50bf65bab69aa6d01f759732927fbbf1c8abfe15.zip
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>
Diffstat (limited to 'block.c')
-rw-r--r--block.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/block.c b/block.c
index b9e5114a27..15a4e75ff5 100644
--- a/block.c
+++ b/block.c
@@ -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);
}
/*