[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 12/48] block: Allow specifying child options in reope
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 12/48] block: Allow specifying child options in reopen |
Date: |
Fri, 18 Dec 2015 16:07:18 +0100 |
If the child was defined in the same context (-drive argument or
blockdev-add QMP command) as its parent, a reopen of the parent should
work the same and allow changing options of the child.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
---
block.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/block.c b/block.c
index 2c41fff..9c42b17 100644
--- a/block.c
+++ b/block.c
@@ -1720,15 +1720,23 @@ BlockReopenQueue *bdrv_reopen_queue(BlockReopenQueue
*bs_queue,
flags &= ~BDRV_O_PROTOCOL;
QLIST_FOREACH(child, &bs->children, next) {
+ QDict *new_child_options;
+ char *child_key_dot;
int child_flags;
+ /* reopen can only change the options of block devices that were
+ * implicitly created and inherited options. For other (referenced)
+ * block devices, a syntax like "backing.foo" results in an error. */
if (child->bs->inherits_from != bs) {
continue;
}
+ child_key_dot = g_strdup_printf("%s.", child->name);
+ qdict_extract_subqdict(options, &new_child_options, child_key_dot);
+ g_free(child_key_dot);
+
child_flags = child->role->inherit_flags(flags);
- /* TODO Pass down child flags (backing.*, extents.*, ...) */
- bdrv_reopen_queue(bs_queue, child->bs, NULL, child_flags);
+ bdrv_reopen_queue(bs_queue, child->bs, new_child_options, child_flags);
}
bs_entry = g_new0(BlockReopenQueueEntry, 1);
--
1.8.3.1
- [Qemu-devel] [PULL 34/48] iotests: Extend test 112 for qemu-img amend, (continued)
- [Qemu-devel] [PULL 34/48] iotests: Extend test 112 for qemu-img amend, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 07/48] block: Allow references for backing files, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 27/48] qcow2: Use error_report() in qcow2_amend_options(), Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 36/48] raw-posix: Make aio=native option binding, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 13/48] block: reopen: Document option precedence and refactor accordingly, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 18/48] qemu-iotests: Remove cache mode test without medium, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 25/48] progress: Allow regressing progress, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 08/48] block: Consider all block layer options in append_open_options, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 22/48] qemu-iotests: Try setting cache mode for children, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 04/48] qcow2: Add .bdrv_join_options callback, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 12/48] block: Allow specifying child options in reopen,
Kevin Wolf <=
- [Qemu-devel] [PULL 26/48] block: Add opaque value to the amend CB, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 48/48] block/qapi: allow best-effort query, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 35/48] qcow2: insert assert into qcow2_get_specific_info(), Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 44/48] block/qapi: do not redundantly print "actual path", Kevin Wolf, 2015/12/18
- Re: [Qemu-devel] [PULL 00/48] Block patches, Peter Maydell, 2015/12/18
- [Qemu-devel] [PULL 45/48] block/qapi: always report full_backing_filename, Kevin Wolf, 2015/12/18
- [Qemu-devel] [PULL 33/48] qcow2: Point to amend function in check, Kevin Wolf, 2015/12/18