aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2021-06-10 15:05:35 +0300
committerKevin Wolf <kwolf@redhat.com>2021-06-29 16:51:00 +0200
commit3d0e8743f0fca85e2d9b98924dcedaa5ab79db4d (patch)
treedab5ba23eba889abded5368e7d40df75d1129022 /block.c
parent25f78d9e2de528473d52acfcf7acdfb64e3453d4 (diff)
downloadqemu-3d0e8743f0fca85e2d9b98924dcedaa5ab79db4d.zip
qemu-3d0e8743f0fca85e2d9b98924dcedaa5ab79db4d.tar.gz
qemu-3d0e8743f0fca85e2d9b98924dcedaa5ab79db4d.tar.bz2
block: BDRVReopenState: drop replace_backing_bs field
It's used only in bdrv_reopen_commit(). "backing" is covered by the loop through all children except for case when we removed backing child during reopen. Make it more obvious and drop extra boolean field: qdict_del will not fail if there is no such entry. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-Id: <20210610120537.196183-8-vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/block.c b/block.c
index 0a73335..ca11078 100644
--- a/block.c
+++ b/block.c
@@ -4296,7 +4296,6 @@ static int bdrv_reopen_parse_backing(BDRVReopenState *reopen_state,
return -EINVAL;
}
- reopen_state->replace_backing_bs = true;
reopen_state->old_backing_bs = bs->backing ? bs->backing->bs : NULL;
return bdrv_set_backing_noperm(bs, new_backing_bs, set_backings_tran, errp);
}
@@ -4550,17 +4549,16 @@ static void bdrv_reopen_commit(BDRVReopenState *reopen_state)
bs->open_flags = reopen_state->flags;
bs->detect_zeroes = reopen_state->detect_zeroes;
- if (reopen_state->replace_backing_bs) {
- qdict_del(bs->explicit_options, "backing");
- qdict_del(bs->options, "backing");
- }
-
/* Remove child references from bs->options and bs->explicit_options.
* Child options were already removed in bdrv_reopen_queue_child() */
QLIST_FOREACH(child, &bs->children, next) {
qdict_del(bs->explicit_options, child->name);
qdict_del(bs->options, child->name);
}
+ /* backing is probably removed, so it's not handled by previous loop */
+ qdict_del(bs->explicit_options, "backing");
+ qdict_del(bs->options, "backing");
+
bdrv_refresh_limits(bs, NULL, NULL);
}