summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorVladimir Sementsov-Ogievskiy2021-04-28 17:17:45 +0200
committerKevin Wolf2021-04-30 12:27:48 +0200
commit3bb0e2980a96db6276e5032dcb2ccbf41f699b59 (patch)
treef02406d97f72be9497d4628afc2d1f55ec89a645 /tests
parentblock: add bdrv_replace_child_safe() transaction action (diff)
downloadqemu-3bb0e2980a96db6276e5032dcb2ccbf41f699b59.tar.gz
qemu-3bb0e2980a96db6276e5032dcb2ccbf41f699b59.tar.xz
qemu-3bb0e2980a96db6276e5032dcb2ccbf41f699b59.zip
block: fix bdrv_replace_node_common
inore_children thing doesn't help to track all propagated permissions of children we want to ignore. The simplest way to correctly update permissions is update graph first and then do permission update. In this case we just referesh permissions for the whole subgraph (in topological-sort defined order) and everything is correctly calculated automatically without any ignore_children. So, refactor bdrv_replace_node_common to first do graph update and then refresh the permissions. Test test_parallel_exclusive_write() now pass, so move it out of debugging "if". Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20210428151804.439460-18-vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/test-bdrv-graph-mod.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/unit/test-bdrv-graph-mod.c b/tests/unit/test-bdrv-graph-mod.c
index e64e81a07c..7b3c8b437a 100644
--- a/tests/unit/test-bdrv-graph-mod.c
+++ b/tests/unit/test-bdrv-graph-mod.c
@@ -408,10 +408,10 @@ int main(int argc, char *argv[])
test_should_update_child);
g_test_add_func("/bdrv-graph-mod/parallel-perm-update",
test_parallel_perm_update);
+ g_test_add_func("/bdrv-graph-mod/parallel-exclusive-write",
+ test_parallel_exclusive_write);
if (debug) {
- g_test_add_func("/bdrv-graph-mod/parallel-exclusive-write",
- test_parallel_exclusive_write);
g_test_add_func("/bdrv-graph-mod/append-greedy-filter",
test_append_greedy_filter);
}