[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 05/21] block: Consider all block layer options in
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH v3 05/21] block: Consider all block layer options in append_open_options |
Date: |
Fri, 4 Dec 2015 14:35:08 +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 0241acd..73f0816 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-devel] [PATCH v3 00/21] block: Cache mode for children etc., Kevin Wolf, 2015/12/04
- [Qemu-devel] [PATCH v3 02/21] block: Fix reopen with semantically overlapping options, Kevin Wolf, 2015/12/04
- [Qemu-devel] [PATCH v3 01/21] qcow2: Add .bdrv_join_options callback, Kevin Wolf, 2015/12/04
- [Qemu-devel] [PATCH v3 03/21] mirror: Error out when a BDS would get two BBs, Kevin Wolf, 2015/12/04
- [Qemu-devel] [PATCH v3 06/21] block: Exclude nested options only for children in append_open_options(), Kevin Wolf, 2015/12/04
- [Qemu-devel] [PATCH v3 04/21] block: Allow references for backing files, Kevin Wolf, 2015/12/04
- [Qemu-devel] [PATCH v3 07/21] block: Pass driver-specific options to .bdrv_refresh_filename(), Kevin Wolf, 2015/12/04
- [Qemu-devel] [PATCH v3 05/21] block: Consider all block layer options in append_open_options,
Kevin Wolf <=
- [Qemu-devel] [PATCH v3 09/21] block: Allow specifying child options in reopen, Kevin Wolf, 2015/12/04
- [Qemu-devel] [PATCH v3 08/21] block: Keep "driver" in bs->options, Kevin Wolf, 2015/12/04
- [Qemu-devel] [PATCH v3 10/21] block: reopen: Document option precedence and refactor accordingly, Kevin Wolf, 2015/12/04
- [Qemu-devel] [PATCH v3 11/21] block: Add infrastructure for option inheritance, Kevin Wolf, 2015/12/04
- [Qemu-devel] [PATCH v3 13/21] block: Introduce bs->explicit_options, Kevin Wolf, 2015/12/04
- [Qemu-devel] [PATCH v3 14/21] blockdev: Set 'format' indicates non-empty drive, Kevin Wolf, 2015/12/04
- [Qemu-devel] [PATCH v3 15/21] qemu-iotests: Remove cache mode test without medium, Kevin Wolf, 2015/12/04
- [Qemu-devel] [PATCH v3 12/21] block: Split out parse_json_protocol(), Kevin Wolf, 2015/12/04
- [Qemu-devel] [PATCH v3 18/21] blkdebug: Enable reopen, Kevin Wolf, 2015/12/04