diff options
-rw-r--r-- | block.c | 3 | ||||
-rw-r--r-- | include/block/block_int.h | 4 |
2 files changed, 7 insertions, 0 deletions
@@ -2853,6 +2853,9 @@ static void change_parent_backing_link(BlockDriverState *from, BdrvChild *c, *next, *to_c; QLIST_FOREACH_SAFE(c, &from->parents, next_parent, next) { + if (c->role->stay_at_node) { + 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 diff --git a/include/block/block_int.h b/include/block/block_int.h index 3177b9f496..a0d9328b59 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -441,6 +441,10 @@ typedef struct BdrvAioNotifier { } BdrvAioNotifier; struct BdrvChildRole { + /* If true, bdrv_replace_in_backing_chain() doesn't change the node this + * BdrvChild points to. */ + bool stay_at_node; + void (*inherit_options)(int *child_flags, QDict *child_options, int parent_flags, QDict *parent_options); |