qemu-e2k/tests
Vladimir Sementsov-Ogievskiy bd57f8f7f8 block: use topological sort for permission update
Rewrite bdrv_check_perm(), bdrv_abort_perm_update() and bdrv_set_perm()
to update nodes in topological sort order instead of simple DFS. With
topologically sorted nodes, we update a node only when all its parents
already updated. With DFS it's not so.

Consider the following example:

    A -+
    |  |
    |  v
    |  B
    |  |
    v  |
    C<-+

A is parent for B and C, B is parent for C.

Obviously, to update permissions, we should go in order A B C, so, when
we update C, all parent permissions already updated. But with current
approach (simple recursion) we can update in sequence A C B C (C is
updated twice). On first update of C, we consider old B permissions, so
doing wrong thing. If it succeed, all is OK, on second C update we will
finish with correct graph. But if the wrong thing failed, we break the
whole process for no reason (it's possible that updated B permission
will be less strict, but we will never check it).

Also new approach gives a way to simultaneously and correctly update
several nodes, we just need to run bdrv_topological_dfs() several times
to add all nodes and their subtrees into one topologically sorted list
(next patch will update bdrv_replace_node() in this manner).

Test test_parallel_perm_update() is now passing, so move it out of
debugging "if".

We also need to support ignore_children in
bdrv_parent_perms_conflict()

For test 283 order of conflicting parents check is changed.

Note also that in bdrv_check_perm() we don't check for parents conflict
at root bs, as we may be in the middle of permission update in
bdrv_reopen_multiple(). bdrv_reopen_multiple() will be updated soon.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20210428151804.439460-14-vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2021-04-30 12:27:48 +02:00
..
acceptance Remove many old deprecated features 2021-03-18 19:00:50 +00:00
bench tests: Move benchmarks into a separate folder 2021-03-12 15:46:30 +01:00
data tests: acpi: update expected blobs 2021-03-22 18:58:19 -04:00
decode decodetree: Improve identifier matching 2020-09-14 14:23:19 +01:00
docker gitlab-ci.yml: Test the dtrace backend in one of the jobs 2021-04-06 15:04:50 +01:00
fp tests/fp/fp-test: Replace the word 'blacklist' 2021-03-09 22:17:06 +01:00
guest-debug chardev: do not use short form boolean options in non-QemuOpts character device descriptions 2021-02-25 15:41:53 +01:00
image-fuzzer image-fuzzer: Use OSerror.strerror instead of tuple subscript 2019-11-05 16:36:11 +01:00
include tests: add missing generated sources to testqapi 2020-10-17 10:45:50 -04:00
keys tests/vm: Add Haiku test based on their vagrant images 2020-11-17 09:45:24 +01:00
migration tests/migration: fix parameter of auto-converge migration 2021-04-07 18:37:56 +01:00
multiboot Remove superfluous .gitignore files 2020-10-13 12:48:17 +02:00
perf/block/qcow2 tests/perf: Test lseek influence on qcow2 block-status 2019-06-04 15:20:41 +02:00
plugin plugins: new syscalls plugin 2021-03-17 07:17:46 +00:00
qapi-schema qapi: Enforce union and alternate branch naming rules 2021-03-23 22:31:53 +01:00
qemu-iotests block: use topological sort for permission update 2021-04-30 12:27:48 +02:00
qtest tests/qtest: add tests for am53c974 device 2021-04-12 22:37:11 +01:00
rocker tests: Avoid non-portable 'echo -ARG' 2017-07-11 17:45:00 +02:00
tcg accel/tcg: Preserve PAGE_ANON when changing page permissions 2021-04-12 11:06:24 +01:00
tsan tests/docker: Added docker build support for TSan. 2020-06-16 14:49:05 +01:00
uefi-test-tools Remove superfluous .gitignore files 2020-10-13 12:48:17 +02:00
unit block: use topological sort for permission update 2021-04-30 12:27:48 +02:00
vm FreeBSD: Upgrade to 12.2 release 2021-03-20 06:33:17 +01:00
vmstate-static-checker-data hw: Replace anti-social QOM type names 2021-03-19 15:18:43 +01:00
Makefile.include tests: remove "make check-speed" in favor of "make bench" 2021-03-12 15:46:30 +01:00
check-block.sh iotests: rewrite check into python 2021-01-27 20:53:14 +01:00
dbus-vmstate-daemon.sh tests: add dbus-vmstate-test 2020-01-06 18:41:32 +04:00
meson.build tests: Move benchmarks into a separate folder 2021-03-12 15:46:30 +01:00
requirements.txt Acceptance Tests: bump Avocado version requirement to 85.0 2021-02-15 18:56:57 -05:00
test-qht-par.c
vhost-user-bridge.c libvhost-user: make it a meson subproject 2020-12-08 13:48:58 -05:00