aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2017-01-17 13:39:34 +0100
committerKevin Wolf <kwolf@redhat.com>2017-02-28 20:40:37 +0100
commit26de9438c1b6013532fb95de0720e2696588332f (patch)
treefa22c8be003d452f226f4099dec3cc82f198d3f6 /block.c
parentd083319fe007e100b38995d0ea254845c8efa433 (diff)
downloadqemu-26de9438c1b6013532fb95de0720e2696588332f.zip
qemu-26de9438c1b6013532fb95de0720e2696588332f.tar.gz
qemu-26de9438c1b6013532fb95de0720e2696588332f.tar.bz2
block: Add BdrvChildRole.stay_at_node
When the parents' child links are updated in bdrv_append() or bdrv_replace_in_backing_chain(), this should affect all child links of BlockBackends or other nodes, but not on child links held for other purposes (like for setting permissions). This patch allows to control the behaviour per BdrvChildRole. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Acked-by: Fam Zheng <famz@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block.c b/block.c
index f72a67f..9e538a5 100644
--- a/block.c
+++ b/block.c
@@ -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