[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH 41/54] block: Allow backing file links in change_par
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PATCH 41/54] block: Allow backing file links in change_parent_backing_link() |
Date: |
Tue, 21 Feb 2017 15:58:37 +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>
---
block.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/block.c b/block.c
index 97694fa..560e84a 100644
--- a/block.c
+++ b/block.c
@@ -2860,9 +2860,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;
@@ -2873,7 +2873,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 34/54] block: Add BdrvChildRole.stay_at_node, (continued)
- [Qemu-block] [PATCH 34/54] block: Add BdrvChildRole.stay_at_node, Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 36/54] commit: Use real permissions in commit block job, Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 35/54] blockjob: Add permissions to block_job_add_bdrv(), Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 37/54] commit: Use real permissions for HMP 'commit', Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 39/54] block: Fix pending requests check in bdrv_append(), Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 41/54] block: Allow backing file links in change_parent_backing_link(),
Kevin Wolf <=
- [Qemu-block] [PATCH 38/54] backup: Use real permissions in backup block job, Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 40/54] block: BdrvChildRole.attach/detach() callbacks, Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 42/54] mirror: Use real permissions in mirror/active commit block job, Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 43/54] stream: Use real permissions in streaming block job, Kevin Wolf, 2017/02/21
- [Qemu-block] [PATCH 44/54] mirror: Add filter-node-name to blockdev-mirror, Kevin Wolf, 2017/02/21