[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 08/48] block: Consider all block layer options in app
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 08/48] block: Consider all block layer options in append_open_options |
Date: |
Fri, 18 Dec 2015 16:07:14 +0100 |
The code already special-cased "node-name", which is currently the only
option passed in the QDict that isn't driver-specific. Generalise the
code to take all general block layer options into consideration.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
---
block.c | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/block.c b/block.c
index 84b9bf4..0cc3c8b 100644
--- a/block.c
+++ b/block.c
@@ -3950,20 +3950,30 @@ out:
static bool append_open_options(QDict *d, BlockDriverState *bs)
{
const QDictEntry *entry;
+ QemuOptDesc *desc;
bool found_any = false;
for (entry = qdict_first(bs->options); entry;
entry = qdict_next(bs->options, entry))
{
- /* Only take options for this level and exclude all non-driver-specific
- * options */
- if (!strchr(qdict_entry_key(entry), '.') &&
- strcmp(qdict_entry_key(entry), "node-name"))
- {
- qobject_incref(qdict_entry_value(entry));
- qdict_put_obj(d, qdict_entry_key(entry), qdict_entry_value(entry));
- found_any = true;
+ /* Only take options for this level */
+ if (strchr(qdict_entry_key(entry), '.')) {
+ continue;
}
+
+ /* And exclude all non-driver-specific options */
+ for (desc = bdrv_runtime_opts.desc; desc->name; desc++) {
+ if (!strcmp(qdict_entry_key(entry), desc->name)) {
+ break;
+ }
+ }
+ if (desc->name) {
+ continue;
+ }
+
+ qobject_incref(qdict_entry_value(entry));
+ qdict_put_obj(d, qdict_entry_key(entry), qdict_entry_value(entry));
+ found_any = true;
}
return found_any;
--
1.8.3.1
- [Qemu-block] [PULL 40/48] block: fix bdrv_ioctl called from coroutine, (continued)
- [Qemu-block] [PULL 40/48] block: fix bdrv_ioctl called from coroutine, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 39/48] block: use drained section around bdrv_snapshot_delete, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 35/48] qcow2: insert assert into qcow2_get_specific_info(), Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 31/48] qcow2: Add function for refcount order amendment, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 04/48] qcow2: Add .bdrv_join_options callback, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 06/48] mirror: Error out when a BDS would get two BBs, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 22/48] qemu-iotests: Try setting cache mode for children, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 38/48] iotests: Update comments for bdrv_swap() in 094, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 28/48] qcow2: Use abort() instead of assert(false), Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 25/48] progress: Allow regressing progress, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 08/48] block: Consider all block layer options in append_open_options,
Kevin Wolf <=
- [Qemu-block] [PULL 48/48] block/qapi: allow best-effort query, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 27/48] qcow2: Use error_report() in qcow2_amend_options(), Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 29/48] qcow2: Split upgrade/downgrade paths for amend, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 46/48] block/qapi: explicitly warn if !has_full_backing_filename, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 13/48] block: reopen: Document option precedence and refactor accordingly, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 10/48] block: Pass driver-specific options to .bdrv_refresh_filename(), Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 47/48] qemu-img: abort when full_backing_filename not present, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 37/48] block: Remove prototype of bdrv_swap from header, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 30/48] qcow2: Use intermediate helper CB for amend, Kevin Wolf, 2015/12/18
- [Qemu-block] [PULL 16/48] block: Introduce bs->explicit_options, Kevin Wolf, 2015/12/18