[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 32/46] block: Allow backing file links in change_pare
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 32/46] block: Allow backing file links in change_parent_backing_link() |
Date: |
Tue, 28 Feb 2017 21:36:31 +0100 |
Now that the backing file child role implements .attach/.detach
callbacks, nothing prevents us from modifying the graph even if that
involves changing backing file links.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Acked-by: Fam Zheng <address@hidden>
---
block.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/block.c b/block.c
index 698a5c7..79d9ad0 100644
--- a/block.c
+++ b/block.c
@@ -2882,9 +2882,9 @@ static void change_parent_backing_link(BlockDriverState
*from,
continue;
}
if (c->role == &child_backing) {
- /* @from is generally not allowed to be a backing file, except for
- * when @to is the overlay. In that case, @from may not be replaced
- * by @to as @to's backing node. */
+ /* If @from is a backing file of @to, ignore the child to avoid
+ * creating a loop. We only want to change the pointer of other
+ * parents. */
QLIST_FOREACH(to_c, &to->children, next) {
if (to_c == c) {
break;
@@ -2895,7 +2895,6 @@ static void change_parent_backing_link(BlockDriverState
*from,
}
}
- assert(c->role != &child_backing);
bdrv_ref(to);
/* FIXME Are we sure that bdrv_replace_child() can't run into
* &error_abort because of permissions? */
--
1.8.3.1
- [Qemu-block] [PULL 23/46] block: Add BdrvChildRole.get_parent_desc(), (continued)
- [Qemu-block] [PULL 23/46] block: Add BdrvChildRole.get_parent_desc(), Kevin Wolf, 2017/02/28
- [Qemu-block] [PULL 25/46] block: Add BdrvChildRole.stay_at_node, Kevin Wolf, 2017/02/28
- [Qemu-block] [PULL 24/46] block: Include details on permission errors in message, Kevin Wolf, 2017/02/28
- [Qemu-block] [PULL 30/46] block: Fix pending requests check in bdrv_append(), Kevin Wolf, 2017/02/28
- [Qemu-block] [PULL 28/46] commit: Use real permissions for HMP 'commit', Kevin Wolf, 2017/02/28
- [Qemu-block] [PULL 27/46] commit: Use real permissions in commit block job, Kevin Wolf, 2017/02/28
- [Qemu-block] [PULL 29/46] backup: Use real permissions in backup block job, Kevin Wolf, 2017/02/28
- [Qemu-block] [PULL 26/46] blockjob: Add permissions to block_job_add_bdrv(), Kevin Wolf, 2017/02/28
- [Qemu-block] [PULL 31/46] block: BdrvChildRole.attach/detach() callbacks, Kevin Wolf, 2017/02/28
- [Qemu-block] [PULL 33/46] blockjob: Factor out block_job_remove_all_bdrv(), Kevin Wolf, 2017/02/28
- [Qemu-block] [PULL 32/46] block: Allow backing file links in change_parent_backing_link(),
Kevin Wolf <=
- [Qemu-block] [PULL 35/46] stream: Use real permissions in streaming block job, Kevin Wolf, 2017/02/28
- [Qemu-block] [PULL 34/46] mirror: Use real permissions in mirror/active commit block job, Kevin Wolf, 2017/02/28
- [Qemu-block] [PULL 36/46] mirror: Add filter-node-name to blockdev-mirror, Kevin Wolf, 2017/02/28
- [Qemu-block] [PULL 37/46] commit: Add filter-node-name to block-commit, Kevin Wolf, 2017/02/28
- [Qemu-block] [PULL 38/46] hmp: Request permissions in qemu-io, Kevin Wolf, 2017/02/28
- [Qemu-block] [PULL 39/46] migration/block: Use real permissions, Kevin Wolf, 2017/02/28
- [Qemu-block] [PULL 40/46] nbd/server: Use real permissions for NBD exports, Kevin Wolf, 2017/02/28
- [Qemu-block] [PULL 41/46] tests: Remove FIXME comments, Kevin Wolf, 2017/02/28
- [Qemu-block] [PULL 43/46] block: Assertions for write permissions, Kevin Wolf, 2017/02/28
- [Qemu-block] [PULL 42/46] block: Pass BdrvChild to bdrv_aligned_preadv/pwritev and copy-on-read, Kevin Wolf, 2017/02/28