[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [RFC PATCH 33/41] block: Allow backing file links in change
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [RFC PATCH 33/41] block: Allow backing file links in change_parent_backing_link() |
Date: |
Mon, 13 Feb 2017 18:22:55 +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 ff328f1..8224dde 100644
--- a/block.c
+++ b/block.c
@@ -2788,9 +2788,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;
@@ -2801,7 +2801,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] [RFC PATCH 23/41] block: Include details on permission errors in message, (continued)
- [Qemu-block] [RFC PATCH 23/41] block: Include details on permission errors in message, Kevin Wolf, 2017/02/13
- [Qemu-block] [RFC PATCH 24/41] block: Add BdrvChildRole.stay_at_node, Kevin Wolf, 2017/02/13
- [Qemu-block] [RFC PATCH 25/41] blockjob: Add permissions to block_job_add_bdrv(), Kevin Wolf, 2017/02/13
- [Qemu-block] [RFC PATCH 27/41] block: Add bdrv_new_open_driver(), Kevin Wolf, 2017/02/13
- [Qemu-block] [RFC PATCH 28/41] commit: Use real permissions in commit block job, Kevin Wolf, 2017/02/13
- [Qemu-block] [RFC PATCH 29/41] commit: Use real permissions for HMP 'commit', Kevin Wolf, 2017/02/13
- [Qemu-block] [RFC PATCH 30/41] backup: Use real permissions in backup block job, Kevin Wolf, 2017/02/13
- [Qemu-block] [RFC PATCH 33/41] block: Allow backing file links in change_parent_backing_link(),
Kevin Wolf <=
- [Qemu-block] [RFC PATCH 36/41] hmp: Request permissions in qemu-io, Kevin Wolf, 2017/02/13
- [Qemu-block] [RFC PATCH 38/41] nbd/server: Use real permissions for NBD exports, Kevin Wolf, 2017/02/13
- [Qemu-block] [RFC PATCH 26/41] block: Factor out bdrv_open_driver(), Kevin Wolf, 2017/02/13
- [Qemu-block] [RFC PATCH 31/41] block: Fix pending requests check in bdrv_append(), Kevin Wolf, 2017/02/13
- [Qemu-block] [RFC PATCH 32/41] block: BdrvChildRole.attach/detach() callbacks, Kevin Wolf, 2017/02/13
- [Qemu-block] [RFC PATCH 35/41] stream: Use real permissions in streaming block job, Kevin Wolf, 2017/02/13
- [Qemu-block] [RFC PATCH 34/41] mirror: Use real permissions in mirror/active commit block job, Kevin Wolf, 2017/02/13
- [Qemu-block] [RFC PATCH 37/41] migration/block: Use real permissions, Kevin Wolf, 2017/02/13
- [Qemu-block] [RFC PATCH 39/41] tests: Remove FIXME comments, Kevin Wolf, 2017/02/13
- [Qemu-block] [RFC PATCH 40/41] block: Pass BdrvChild to bdrv_aligned_preadv/pwritev, Kevin Wolf, 2017/02/13