Lines Matching full:options
85 QDict *options, int flags,
241 * stripped filename into the options QDict if there is such a prefix.
244 QDict *options) in bdrv_parse_filename_strip_prefix() argument
263 qdict_put(options, "filename", in bdrv_parse_filename_strip_prefix()
268 qdict_put_str(options, "filename", filename); in bdrv_parse_filename_strip_prefix()
639 QDict *options; in bdrv_co_create_opts_simple() local
664 options = qdict_new(); in bdrv_co_create_opts_simple()
665 qdict_put_str(options, "driver", drv->format_name); in bdrv_co_create_opts_simple()
667 blk = blk_co_new_open(filename, NULL, options, in bdrv_co_create_opts_simple()
720 * The format properly removes its options, but the default values remain in bdrv_co_create_file()
721 * in 'opts->list'. So if the protocol has options with the same name in bdrv_co_create_file()
723 * of the format, since for overlapping options, the format wins. in bdrv_co_create_file()
726 * only the set options, and then convert it back to QemuOpts, using the in bdrv_co_create_file()
1086 * Combines a QDict of new block driver @options with any missing options taken
1089 static void bdrv_join_options(BlockDriverState *bs, QDict *options, in bdrv_join_options() argument
1094 bs->drv->bdrv_join_options(options, old_options); in bdrv_join_options()
1096 qdict_join(options, old_options, false); in bdrv_join_options()
1239 * Returns the options and flags that a temporary snapshot should get, based on
1253 /* Copy the read-only and discard options from the parent */ in bdrv_temp_snapshot_options()
1360 * Returns the options and flags that a generic child of a BDS should
1361 * get, based on the given options and flags for the parent BDS.
1583 static void update_options_from_flags(QDict *options, int flags) in update_options_from_flags() argument
1586 if (!qdict_haskey(options, BDRV_OPT_CACHE_DIRECT)) { in update_options_from_flags()
1587 qdict_put_bool(options, BDRV_OPT_CACHE_DIRECT, flags & BDRV_O_NOCACHE); in update_options_from_flags()
1589 if (!qdict_haskey(options, BDRV_OPT_CACHE_NO_FLUSH)) { in update_options_from_flags()
1590 qdict_put_bool(options, BDRV_OPT_CACHE_NO_FLUSH, in update_options_from_flags()
1593 if (!qdict_haskey(options, BDRV_OPT_READ_ONLY)) { in update_options_from_flags()
1594 qdict_put_bool(options, BDRV_OPT_READ_ONLY, !(flags & BDRV_O_RDWR)); in update_options_from_flags()
1596 if (!qdict_haskey(options, BDRV_OPT_AUTO_READ_ONLY)) { in update_options_from_flags()
1597 qdict_put_bool(options, BDRV_OPT_AUTO_READ_ONLY, in update_options_from_flags()
1648 QDict *options, int open_flags, Error **errp) in bdrv_open_driver() argument
1665 ret = drv->bdrv_open(bs, options, open_flags, &local_err); in bdrv_open_driver()
1741 * @options is a QDict of options to pass to the block drivers, or NULL for an
1742 * empty set of options. The reference to the QDict belongs to the block layer
1748 QDict *options, int flags, in bdrv_new_open_driver_opts() argument
1758 bs->options = options ?: qdict_new(); in bdrv_new_open_driver_opts()
1759 bs->explicit_options = qdict_clone_shallow(bs->options); in bdrv_new_open_driver_opts()
1762 update_options_from_flags(bs->options, flags); in bdrv_new_open_driver_opts()
1764 ret = bdrv_open_driver(bs, drv, node_name, bs->options, flags, errp); in bdrv_new_open_driver_opts()
1768 qobject_unref(bs->options); in bdrv_new_open_driver_opts()
1769 bs->options = NULL; in bdrv_new_open_driver_opts()
1864 * Removes all processed options from *options.
1867 QDict *options, Error **errp) in bdrv_open_common() argument
1883 assert(options != NULL && bs->options != options); in bdrv_open_common()
1887 if (!qemu_opts_absorb_qdict(opts, options, errp)) { in bdrv_open_common()
1917 * non-string types would require more care. When @options in bdrv_open_common()
1922 filename = qdict_get_try_str(options, "filename"); in bdrv_open_common()
1997 ret = bdrv_open_driver(bs, drv, node_name, options, open_flags, errp); in bdrv_open_common()
2014 QDict *options; in parse_json_filename() local
2023 error_prepend(errp, "Could not parse the JSON options: "); in parse_json_filename()
2027 options = qobject_to(QDict, options_obj); in parse_json_filename()
2028 if (!options) { in parse_json_filename()
2034 qdict_flatten(options); in parse_json_filename()
2036 return options; in parse_json_filename()
2039 static void parse_json_protocol(QDict *options, const char **pfilename, in parse_json_protocol() argument
2057 /* Options given in the filename have lower priority than options in parse_json_protocol()
2059 qdict_join(options, json_options, false); in parse_json_protocol()
2065 * Fills in default options for opening images and converts the legacy
2070 static int bdrv_fill_options(QDict **options, const char *filename, in bdrv_fill_options() argument
2084 * types would require more care. When @options come from in bdrv_fill_options()
2089 drvname = qdict_get_try_str(*options, "driver"); in bdrv_fill_options()
2107 /* Translate cache options from flags into options */ in bdrv_fill_options()
2108 update_options_from_flags(*options, *flags); in bdrv_fill_options()
2110 /* Fetch the file name from the options QDict if necessary */ in bdrv_fill_options()
2112 if (!qdict_haskey(*options, "filename")) { in bdrv_fill_options()
2113 qdict_put_str(*options, "filename", filename); in bdrv_fill_options()
2116 error_setg(errp, "Can't specify 'file' and 'filename' options at " in bdrv_fill_options()
2123 /* See cautionary note on accessing @options above */ in bdrv_fill_options()
2124 filename = qdict_get_try_str(*options, "filename"); in bdrv_fill_options()
2134 qdict_put_str(*options, "driver", drvname); in bdrv_fill_options()
2145 drv->bdrv_parse_filename(filename, *options, &local_err); in bdrv_fill_options()
2152 qdict_del(*options, "filename"); in bdrv_fill_options()
3617 * bdref_key specifies the key for the image's BlockdevRef in the options QDict.
3619 * itself, all options starting with "${bdref_key}." are considered part of the
3634 QDict *options; in bdrv_open_backing_file() local
3645 /* NULL means an empty set of options */ in bdrv_open_backing_file()
3654 qdict_extract_subqdict(parent_options, &options, bdref_key_dot); in bdrv_open_backing_file()
3665 if (reference || qdict_haskey(options, "file.filename")) { in bdrv_open_backing_file()
3667 } else if (bs->backing_file[0] == '\0' && qdict_size(options) == 0) { in bdrv_open_backing_file()
3668 qobject_unref(options); in bdrv_open_backing_file()
3671 if (qdict_size(options) == 0) { in bdrv_open_backing_file()
3672 /* If the user specifies options that do not modify the in bdrv_open_backing_file()
3675 * just specifying some of the backing BDS's options is in bdrv_open_backing_file()
3685 qobject_unref(options); in bdrv_open_backing_file()
3693 qobject_unref(options); in bdrv_open_backing_file()
3698 bs->backing_format[0] != '\0' && !qdict_haskey(options, "driver")) { in bdrv_open_backing_file()
3699 qdict_put_str(options, "driver", bs->backing_format); in bdrv_open_backing_file()
3702 backing_hd = bdrv_open_inherit(backing_filename, reference, options, 0, bs, in bdrv_open_backing_file()
3736 bdrv_open_child_bs(const char *filename, QDict *options, const char *bdref_key, in bdrv_open_child_bs() argument
3749 qdict_extract_subqdict(options, &image_options, bdref_key_dot); in bdrv_open_child_bs()
3754 * types would require more care. When @options come from in bdrv_open_child_bs()
3759 reference = qdict_get_try_str(options, bdref_key); in bdrv_open_child_bs()
3777 qdict_del(options, bdref_key); in bdrv_open_child_bs()
3782 QDict *options, const char *bdref_key, in bdrv_open_child_common() argument
3794 bs = bdrv_open_child_bs(filename, options, bdref_key, parent, child_class, in bdrv_open_child_common()
3811 * Opens a disk image whose options are given as BlockdevRef in another block
3812 * device's options.
3817 * bdrev_key specifies the key for the image's BlockdevRef in the options QDict.
3819 * itself, all options starting with "${bdref_key}." are considered part of the
3822 * The BlockdevRef will be removed from the options QDict.
3827 QDict *options, const char *bdref_key, in bdrv_open_child() argument
3833 return bdrv_open_child_common(filename, options, bdref_key, parent, in bdrv_open_child()
3846 QDict *options, const char *bdref_key, in bdrv_open_file_child() argument
3856 if (!bdrv_open_child_common(filename, options, bdref_key, parent, in bdrv_open_file_child()
3882 BlockdevOptions *options = &ref->u.definition; in bdrv_open_blockdev_ref() local
3886 visit_type_BlockdevOptions(v, NULL, &options, &error_abort); in bdrv_open_blockdev_ref()
3952 /* Prepare options QDict for the temporary file */ in bdrv_append_temp_snapshot()
3977 * options is a QDict of options to pass to the block drivers, or NULL for an
3978 * empty set of options. The reference to the QDict belongs to the block layer
3986 * should be opened. If specified, neither options nor a filename may be given,
3990 bdrv_open_inherit(const char *filename, const char *reference, QDict *options, in bdrv_open_inherit() argument
4015 bool options_non_empty = options ? qdict_size(options) : false; in bdrv_open_inherit()
4016 qobject_unref(options); in bdrv_open_inherit()
4020 "additional options or a new filename"); in bdrv_open_inherit()
4035 /* NULL means an empty set of options */ in bdrv_open_inherit()
4036 if (options == NULL) { in bdrv_open_inherit()
4037 options = qdict_new(); in bdrv_open_inherit()
4040 /* json: syntax counts as explicit options, as if in the QDict */ in bdrv_open_inherit()
4042 parse_json_protocol(options, &filename, &local_err); in bdrv_open_inherit()
4048 bs->explicit_options = qdict_clone_shallow(options); in bdrv_open_inherit()
4066 &flags, options, in bdrv_open_inherit()
4067 parent->open_flags, parent->options); in bdrv_open_inherit()
4070 ret = bdrv_fill_options(&options, filename, &flags, parse_filename, in bdrv_open_inherit()
4078 * Caution: getting a boolean member of @options requires care. in bdrv_open_inherit()
4079 * When @options come from -blockdev or blockdev_add, members are in bdrv_open_inherit()
4083 if (g_strcmp0(qdict_get_try_str(options, BDRV_OPT_READ_ONLY), "on") && in bdrv_open_inherit()
4084 !qdict_get_try_bool(options, BDRV_OPT_READ_ONLY, false)) { in bdrv_open_inherit()
4093 flags, options); in bdrv_open_inherit()
4095 qdict_del(options, BDRV_OPT_READ_ONLY); in bdrv_open_inherit()
4097 &flags, options, flags, options); in bdrv_open_inherit()
4101 bs->options = options; in bdrv_open_inherit()
4102 options = qdict_clone_shallow(options); in bdrv_open_inherit()
4105 /* See cautionary note on accessing @options above */ in bdrv_open_inherit()
4106 drvname = qdict_get_try_str(options, "driver"); in bdrv_open_inherit()
4117 /* See cautionary note on accessing @options above */ in bdrv_open_inherit()
4118 backing = qdict_get_try_str(options, "backing"); in bdrv_open_inherit()
4119 if (qobject_to(QNull, qdict_get(options, "backing")) != NULL || in bdrv_open_inherit()
4128 qdict_del(bs->options, "backing"); in bdrv_open_inherit()
4129 qdict_del(options, "backing"); in bdrv_open_inherit()
4134 * same BDS, which is why we put the node name back into options. */ in bdrv_open_inherit()
4138 file_bs = bdrv_open_child_bs(filename, options, "file", bs, in bdrv_open_inherit()
4157 qdict_put_str(options, "file", bdrv_get_node_name(file_bs)); in bdrv_open_inherit()
4171 * opening bs->file already requires the (mostly) final set of options in bdrv_open_inherit()
4176 * sure to update both bs->options (which has the full effective in bdrv_open_inherit()
4177 * options for bs) and options (which has file.* already removed). in bdrv_open_inherit()
4179 qdict_put_str(bs->options, "driver", drv->format_name); in bdrv_open_inherit()
4180 qdict_put_str(options, "driver", drv->format_name); in bdrv_open_inherit()
4193 ret = bdrv_open_common(bs, file, options, &local_err); in bdrv_open_inherit()
4205 ret = bdrv_open_backing_file(bs, options, "backing", &local_err); in bdrv_open_inherit()
4211 /* Remove all children options and references in bdrv_open_inherit()
4212 * from bs->options and bs->explicit_options */ in bdrv_open_inherit()
4217 qdict_extract_subqdict(bs->options, NULL, child_key_dot); in bdrv_open_inherit()
4219 qdict_del(bs->options, child->name); in bdrv_open_inherit()
4223 /* Check if any unknown options were used */ in bdrv_open_inherit()
4224 if (qdict_size(options) != 0) { in bdrv_open_inherit()
4225 const QDictEntry *entry = qdict_first(options); in bdrv_open_inherit()
4240 qobject_unref(options); in bdrv_open_inherit()
4241 options = NULL; in bdrv_open_inherit()
4267 qobject_unref(bs->options); in bdrv_open_inherit()
4268 qobject_unref(options); in bdrv_open_inherit()
4269 bs->options = NULL; in bdrv_open_inherit()
4278 qobject_unref(options); in bdrv_open_inherit()
4284 QDict *options, int flags, Error **errp) in bdrv_open() argument
4288 return bdrv_open_inherit(filename, reference, options, flags, NULL, in bdrv_open()
4307 * Check that every option set in @bs->options is also set in
4310 * Options listed in the common_options list and in
4319 /* These options are common to all block drivers and are handled in bdrv_reset_options_allowed()
4326 for (e = qdict_first(bs->options); e; e = qdict_next(bs->options, e)) { in bdrv_reset_options_allowed()
4372 * options contains the changed options for the associated bs
4384 QDict *options, const BdrvChildClass *klass, in bdrv_reopen_queue_child() argument
4406 if (!options) { in bdrv_reopen_queue_child()
4407 options = qdict_new(); in bdrv_reopen_queue_child()
4418 * Precedence of options: in bdrv_reopen_queue_child()
4419 * 1. Explicitly passed in options (highest) in bdrv_reopen_queue_child()
4420 * 2. Retained from explicitly set options of bs in bdrv_reopen_queue_child()
4422 * 4. Retained from effective options of bs in bdrv_reopen_queue_child()
4430 bdrv_join_options(bs, options, old_options); in bdrv_reopen_queue_child()
4434 explicit_options = qdict_clone_shallow(options); in bdrv_reopen_queue_child()
4439 klass->inherit_options(role, parent_is_format, &flags, options, in bdrv_reopen_queue_child()
4446 /* Old values are used for options that aren't set yet */ in bdrv_reopen_queue_child()
4447 old_options = qdict_clone_shallow(bs->options); in bdrv_reopen_queue_child()
4448 bdrv_join_options(bs, options, old_options); in bdrv_reopen_queue_child()
4452 /* We have the final set of options so let's update the flags */ in bdrv_reopen_queue_child()
4453 options_copy = qdict_clone_shallow(options); in bdrv_reopen_queue_child()
4470 qobject_unref(bs_entry->state.options); in bdrv_reopen_queue_child()
4475 bs_entry->state.options = options; in bdrv_reopen_queue_child()
4481 * options must be reset to their original value. We don't allow in bdrv_reopen_queue_child()
4487 !qdict_haskey(options, "backing") && in bdrv_reopen_queue_child()
4488 !qdict_haskey(options, "backing.driver"); in bdrv_reopen_queue_child()
4495 /* reopen can only change the options of block devices that were in bdrv_reopen_queue_child()
4496 * implicitly created and inherited options. For other (referenced) in bdrv_reopen_queue_child()
4502 /* Check if the options contain a child reference */ in bdrv_reopen_queue_child()
4503 if (qdict_haskey(options, child->name)) { in bdrv_reopen_queue_child()
4504 const char *childref = qdict_get_try_str(options, child->name); in bdrv_reopen_queue_child()
4514 * reopen it with its existing set of options (note that in bdrv_reopen_queue_child()
4515 * it can still inherit new options from the parent). in bdrv_reopen_queue_child()
4519 /* Extract child options ("child-name.*") */ in bdrv_reopen_queue_child()
4522 qdict_extract_subqdict(options, &new_child_options, child_key_dot); in bdrv_reopen_queue_child()
4528 options, flags, child_keep_old); in bdrv_reopen_queue_child()
4536 QDict *options, bool keep_old_opts) in bdrv_reopen_queue() argument
4547 return bdrv_reopen_queue_child(bs_queue, bs, options, NULL, 0, false, in bdrv_reopen_queue()
4558 qobject_unref(bs_entry->state.options); in bdrv_reopen_queue_free()
4712 * reopen_state->options QDict is valid or not.
4752 value = qdict_get(reopen_state->options, child_name); in bdrv_reopen_parse_file_or_backing()
4782 * The options QDict has been flattened, so 'backing' and 'file' in bdrv_reopen_parse_file_or_backing()
4891 * entries from reopen_state->options as they are processed, so in bdrv_reopen_prepare()
4893 orig_reopen_opts = qdict_clone_shallow(reopen_state->options); in bdrv_reopen_prepare()
4895 /* Process generic block layer options */ in bdrv_reopen_prepare()
4897 if (!qemu_opts_absorb_qdict(opts, reopen_state->options, errp)) { in bdrv_reopen_prepare()
4903 * are up-to-date. This time we simply want to remove the options from in bdrv_reopen_prepare()
4926 /* All other options (including node-name and driver) must be unchanged. in bdrv_reopen_prepare()
4929 qemu_opts_to_qdict(opts, reopen_state->options); in bdrv_reopen_prepare()
4948 * But not all options allow that, so we need to check it first. in bdrv_reopen_prepare()
4951 reopen_state->options, errp); in bdrv_reopen_prepare()
5009 qdict_del(reopen_state->options, "backing"); in bdrv_reopen_prepare()
5017 qdict_del(reopen_state->options, "file"); in bdrv_reopen_prepare()
5019 /* Options that are not handled are only okay if they are unchanged in bdrv_reopen_prepare()
5020 * compared to the old state. It is expected that some options are only in bdrv_reopen_prepare()
5022 if (qdict_size(reopen_state->options)) { in bdrv_reopen_prepare()
5023 const QDictEntry *entry = qdict_first(reopen_state->options); in bdrv_reopen_prepare()
5029 QObject *old = qdict_get(reopen_state->bs->options, entry->key); in bdrv_reopen_prepare()
5050 * TODO: When using -drive to specify blockdev options, all values in bdrv_reopen_prepare()
5054 * In contrast, reopening options are (currently) always strings in bdrv_reopen_prepare()
5056 * callers do not specify any options). in bdrv_reopen_prepare()
5058 * this cannot detect non-string options as unchanged, because in bdrv_reopen_prepare()
5061 * all options. For now, this is not too big of an issue because in bdrv_reopen_prepare()
5062 * the user can simply omit options which cannot be changed anyway, in bdrv_reopen_prepare()
5070 } while ((entry = qdict_next(reopen_state->options, entry))); in bdrv_reopen_prepare()
5075 /* Restore the original reopen_state->options QDict */ in bdrv_reopen_prepare()
5076 qobject_unref(reopen_state->options); in bdrv_reopen_prepare()
5077 reopen_state->options = qobject_ref(orig_reopen_opts); in bdrv_reopen_prepare()
5121 qobject_unref(bs->options); in bdrv_reopen_commit()
5123 qobject_ref(reopen_state->options); in bdrv_reopen_commit()
5126 bs->options = reopen_state->options; in bdrv_reopen_commit()
5130 /* Remove child references from bs->options and bs->explicit_options. in bdrv_reopen_commit()
5131 * Child options were already removed in bdrv_reopen_queue_child() */ in bdrv_reopen_commit()
5134 qdict_del(bs->options, child->name); in bdrv_reopen_commit()
5138 qdict_del(bs->options, "backing"); in bdrv_reopen_commit()
5202 qobject_unref(bs->options); in bdrv_close()
5204 bs->options = NULL; in bdrv_close()
5601 * @options is a QDict of options to pass to the block drivers, or NULL for an
5602 * empty set of options. The reference to the QDict belongs to the block layer
5607 * @options must not refer to nodes in a different AioContext.
5609 BlockDriverState *bdrv_insert_node(BlockDriverState *bs, QDict *options, in bdrv_insert_node() argument
5619 drvname = qdict_get_try_str(options, "driver"); in bdrv_insert_node()
5631 node_name = qdict_get_try_str(options, "node-name"); in bdrv_insert_node()
5635 new_node_bs = bdrv_new_open_driver_opts(drv, node_name, options, flags, in bdrv_insert_node()
5639 options = NULL; /* bdrv_new_open_driver() eats options */ in bdrv_insert_node()
5667 qobject_unref(options); in bdrv_insert_node()
6057 * @opts: Creation options for new image
7316 char *options, uint64_t img_size, int flags, bool quiet, in bdrv_img_create() argument
7329 /* Find driver and parse its options */ in bdrv_img_create()
7359 /* Parse -o options */ in bdrv_img_create()
7360 if (options) { in bdrv_img_create()
7361 if (!qemu_opts_do_parse(opts, options, NULL, errp)) { in bdrv_img_create()
7956 * "read-zeroes" options are strong, but its "latency-ns" option is
7959 * If a key returned by this function ends with a dot, all options
7982 * Copies all strong runtime options from bs->options to the given
7986 * Returns true iff any strong option was present in bs->options (and
7989 * whether the existence of strong options prevents the generation of
8006 QObject *entry = qdict_get(bs->options, *option_name); in append_strong_runtime_options()
8015 for (entry = qdict_first(bs->options); entry; in append_strong_runtime_options()
8016 entry = qdict_next(bs->options, entry)) in append_strong_runtime_options()
8063 * other options; so reading and writing must return the same
8065 * - full_open_options: Options which, when given when opening a block device
8119 /* Gather the options QDict */ in bdrv_refresh_filename()
8126 * options, or name them differently from BdrvChild.name */ in bdrv_refresh_filename()
8161 * either through an options dict, or through a special in bdrv_refresh_filename()
8176 * some explicit (strong) options in bdrv_refresh_filename()