Lines Matching refs:reopen_state

101 static int bdrv_reopen_prepare(BDRVReopenState *reopen_state,
104 static void bdrv_reopen_commit(BDRVReopenState *reopen_state);
105 static void bdrv_reopen_abort(BDRVReopenState *reopen_state);
4672 * reopen_state->options QDict is valid or not.
4677 * reopen_state->bs then return 0.
4681 * If that's the case then reopen_state->replace_backing_bs is set to
4682 * true and reopen_state->new_backing_bs contains a pointer to the new
4690 * @reopen_state->bs can move to a different AioContext in this function.
4693 bdrv_reopen_parse_file_or_backing(BDRVReopenState *reopen_state,
4697 BlockDriverState *bs = reopen_state->bs;
4709 value = qdict_get(reopen_state->options, child_name);
4777 reopen_state->old_backing_bs = old_child_bs;
4779 reopen_state->old_file_bs = old_child_bs;
4827 bdrv_reopen_prepare(BDRVReopenState *reopen_state, BlockReopenQueue *queue,
4840 assert(reopen_state != NULL);
4841 assert(reopen_state->bs->drv != NULL);
4843 drv = reopen_state->bs->drv;
4846 * entries from reopen_state->options as they are processed, so
4848 orig_reopen_opts = qdict_clone_shallow(reopen_state->options);
4852 if (!qemu_opts_absorb_qdict(opts, reopen_state->options, errp)) {
4860 old_flags = reopen_state->flags;
4861 update_flags_from_options(&reopen_state->flags, opts);
4862 assert(old_flags == reopen_state->flags);
4866 if (bdrv_parse_discard_flags(discard, &reopen_state->flags) != 0) {
4873 reopen_state->detect_zeroes =
4874 bdrv_parse_detect_zeroes(opts, reopen_state->flags, &local_err);
4884 qemu_opts_to_qdict(opts, reopen_state->options);
4889 read_only = !(reopen_state->flags & BDRV_O_RDWR);
4892 ret = bdrv_can_set_read_only(reopen_state->bs, read_only, true, &local_err);
4905 ret = bdrv_reset_options_allowed(reopen_state->bs,
4906 reopen_state->options, errp);
4911 ret = drv->bdrv_reopen_prepare(reopen_state, queue, &local_err);
4917 bdrv_refresh_filename(reopen_state->bs);
4920 reopen_state->bs->filename);
4930 bdrv_get_device_or_node_name(reopen_state->bs));
4944 if (drv->supports_backing && reopen_state->backing_missing &&
4945 (reopen_state->bs->backing || reopen_state->bs->backing_file[0])) {
4947 reopen_state->bs->node_name);
4959 ret = bdrv_reopen_parse_file_or_backing(reopen_state, true,
4964 qdict_del(reopen_state->options, "backing");
4967 ret = bdrv_reopen_parse_file_or_backing(reopen_state, false,
4972 qdict_del(reopen_state->options, "file");
4977 if (qdict_size(reopen_state->options)) {
4978 const QDictEntry *entry = qdict_first(reopen_state->options);
4984 QObject *old = qdict_get(reopen_state->bs->options, entry->key);
4990 QLIST_FOREACH(child, &reopen_state->bs->children, next) {
5025 } while ((entry = qdict_next(reopen_state->options, entry)));
5030 /* Restore the original reopen_state->options QDict */
5031 qobject_unref(reopen_state->options);
5032 reopen_state->options = qobject_ref(orig_reopen_opts);
5041 drv->bdrv_reopen_abort(reopen_state);
5055 static void GRAPH_UNLOCKED bdrv_reopen_commit(BDRVReopenState *reopen_state)
5061 assert(reopen_state != NULL);
5062 bs = reopen_state->bs;
5069 drv->bdrv_reopen_commit(reopen_state);
5077 qobject_ref(reopen_state->explicit_options);
5078 qobject_ref(reopen_state->options);
5080 bs->explicit_options = reopen_state->explicit_options;
5081 bs->options = reopen_state->options;
5082 bs->open_flags = reopen_state->flags;
5083 bs->detect_zeroes = reopen_state->detect_zeroes;
5101 * reopen_state
5103 static void GRAPH_UNLOCKED bdrv_reopen_abort(BDRVReopenState *reopen_state)
5107 assert(reopen_state != NULL);
5108 drv = reopen_state->bs->drv;
5113 drv->bdrv_reopen_abort(reopen_state);