[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v2 30/43] block: Allow backing file links in change_
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PATCH v2 30/43] block: Allow backing file links in change_parent_backing_link() |
Date: |
Mon, 27 Feb 2017 21:09: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>
---
block.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/block.c b/block.c
index 86567a8..af2b8ff 100644
--- a/block.c
+++ b/block.c
@@ -2872,9 +2872,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;
@@ -2885,7 +2885,6 @@ static void change_parent_backing_link(BlockDriverState
*from,
}
}
- assert(c->role != &child_backing);
bdrv_ref(to);
bdrv_replace_child(c, to);
bdrv_unref(from);
--
1.8.3.1
- [Qemu-block] [PATCH v2 20/43] blockjob: Add permissions to block_job_create(), (continued)
- [Qemu-block] [PATCH v2 20/43] blockjob: Add permissions to block_job_create(), Kevin Wolf, 2017/02/27
- [Qemu-block] [PATCH v2 21/43] block: Add BdrvChildRole.get_parent_desc(), Kevin Wolf, 2017/02/27
- [Qemu-block] [PATCH v2 22/43] block: Include details on permission errors in message, Kevin Wolf, 2017/02/27
- [Qemu-block] [PATCH v2 23/43] block: Add BdrvChildRole.stay_at_node, Kevin Wolf, 2017/02/27
- [Qemu-block] [PATCH v2 24/43] blockjob: Add permissions to block_job_add_bdrv(), Kevin Wolf, 2017/02/27
- [Qemu-block] [PATCH v2 25/43] commit: Use real permissions in commit block job, Kevin Wolf, 2017/02/27
- [Qemu-block] [PATCH v2 26/43] commit: Use real permissions for HMP 'commit', Kevin Wolf, 2017/02/27
- [Qemu-block] [PATCH v2 27/43] backup: Use real permissions in backup block job, Kevin Wolf, 2017/02/27
- [Qemu-block] [PATCH v2 28/43] block: Fix pending requests check in bdrv_append(), Kevin Wolf, 2017/02/27
- [Qemu-block] [PATCH v2 29/43] block: BdrvChildRole.attach/detach() callbacks, Kevin Wolf, 2017/02/27
- [Qemu-block] [PATCH v2 30/43] block: Allow backing file links in change_parent_backing_link(),
Kevin Wolf <=
- [Qemu-block] [PATCH v2 32/43] stream: Use real permissions in streaming block job, Kevin Wolf, 2017/02/27
- [Qemu-block] [PATCH v2 31/43] mirror: Use real permissions in mirror/active commit block job, Kevin Wolf, 2017/02/27
- [Qemu-block] [PATCH v2 33/43] mirror: Add filter-node-name to blockdev-mirror, Kevin Wolf, 2017/02/27
- [Qemu-block] [PATCH v2 34/43] commit: Add filter-node-name to block-commit, Kevin Wolf, 2017/02/27
- [Qemu-block] [PATCH v2 35/43] hmp: Request permissions in qemu-io, Kevin Wolf, 2017/02/27
- [Qemu-block] [PATCH v2 36/43] migration/block: Use real permissions, Kevin Wolf, 2017/02/27
- [Qemu-block] [PATCH v2 37/43] nbd/server: Use real permissions for NBD exports, Kevin Wolf, 2017/02/27
- [Qemu-block] [PATCH v2 38/43] tests: Remove FIXME comments, Kevin Wolf, 2017/02/27
- [Qemu-block] [PATCH v2 39/43] block: Pass BdrvChild to bdrv_aligned_preadv/pwritev and copy-on-read, Kevin Wolf, 2017/02/27
- [Qemu-block] [PATCH v2 40/43] block: Assertions for write permissions, Kevin Wolf, 2017/02/27