[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v3 30/44] block: Allow backing file links in change_
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PATCH v3 30/44] block: Allow backing file links in change_parent_backing_link() |
Date: |
Tue, 28 Feb 2017 13:54:15 +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 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
- Re: [Qemu-block] [PATCH v3 22/44] block: Include details on permission errors in message, (continued)
- [Qemu-block] [PATCH v3 20/44] blockjob: Add permissions to block_job_create(), Kevin Wolf, 2017/02/28
- [Qemu-block] [PATCH v3 23/44] block: Add BdrvChildRole.stay_at_node, Kevin Wolf, 2017/02/28
- [Qemu-block] [PATCH v3 24/44] blockjob: Add permissions to block_job_add_bdrv(), Kevin Wolf, 2017/02/28
- [Qemu-block] [PATCH v3 26/44] commit: Use real permissions for HMP 'commit', Kevin Wolf, 2017/02/28
- [Qemu-block] [PATCH v3 25/44] commit: Use real permissions in commit block job, Kevin Wolf, 2017/02/28
- [Qemu-block] [PATCH v3 27/44] backup: Use real permissions in backup block job, Kevin Wolf, 2017/02/28
- [Qemu-block] [PATCH v3 28/44] block: Fix pending requests check in bdrv_append(), Kevin Wolf, 2017/02/28
- [Qemu-block] [PATCH v3 29/44] block: BdrvChildRole.attach/detach() callbacks, Kevin Wolf, 2017/02/28
- [Qemu-block] [PATCH v3 30/44] block: Allow backing file links in change_parent_backing_link(),
Kevin Wolf <=
- [Qemu-block] [PATCH v3 31/44] blockjob: Factor out block_job_remove_all_bdrv(), Kevin Wolf, 2017/02/28
- [Qemu-block] [PATCH v3 33/44] stream: Use real permissions in streaming block job, Kevin Wolf, 2017/02/28
- [Qemu-block] [PATCH v3 32/44] mirror: Use real permissions in mirror/active commit block job, Kevin Wolf, 2017/02/28
- [Qemu-block] [PATCH v3 34/44] mirror: Add filter-node-name to blockdev-mirror, Kevin Wolf, 2017/02/28
- [Qemu-block] [PATCH v3 35/44] commit: Add filter-node-name to block-commit, Kevin Wolf, 2017/02/28
- [Qemu-block] [PATCH v3 36/44] hmp: Request permissions in qemu-io, Kevin Wolf, 2017/02/28
- [Qemu-block] [PATCH v3 37/44] migration/block: Use real permissions, Kevin Wolf, 2017/02/28