qemu/tests/qemu-iotests/tests
Vladimir Sementsov-Ogievskiy a13de40a05 block: bdrv_inactivate_recurse(): check for permissions and fix crash
We must not inactivate child when parent has write permissions on
it.

Calling .bdrv_inactivate() doesn't help: actually only qcow2 has this
handler and it is used to flush caches, not for permission
manipulations.

So, let's simply check cumulative parent permissions before
inactivating the node.

This commit fixes a crash when we do migration during backup: prior to
the commit nothing prevents all nodes inactivation at migration finish
and following backup write to the target crashes on assertion
"assert(!(bs->open_flags & BDRV_O_INACTIVE));" in
bdrv_co_write_req_prepare().

After the commit, we rely on the fact that copy-before-write filter
keeps write permission on target node to be able to write to it. So
inactivation fails and migration fails as expected.

Corresponding test now passes, so, enable it.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20210911120027.8063-3-vsementsov@virtuozzo.com>
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
2021-09-15 15:54:07 +02:00
..
fuse-allow-other iotests/fuse-allow-other: Test allow-other 2021-07-09 12:26:05 +02:00
fuse-allow-other.out iotests/fuse-allow-other: Test allow-other 2021-07-09 12:26:05 +02:00
image-fleecing iotests/image-fleecing: add test-case for copy-before-write filter 2021-09-01 14:38:08 +02:00
image-fleecing.out iotests/image-fleecing: add test-case for copy-before-write filter 2021-09-01 14:38:08 +02:00
migrate-bitmaps-postcopy-test migrate-bitmaps-postcopy-test: Fix pylint warnings 2021-09-15 15:54:07 +02:00
migrate-bitmaps-postcopy-test.out
migrate-bitmaps-test migrate-bitmaps-test: Fix pylint warnings 2021-09-15 15:54:07 +02:00
migrate-bitmaps-test.out
migrate-during-backup block: bdrv_inactivate_recurse(): check for permissions and fix crash 2021-09-15 15:54:07 +02:00
migrate-during-backup.out tests: add migrate-during-backup 2021-09-15 15:54:07 +02:00
mirror-top-perms mirror-top-perms: Fix AbnormalShutdown path 2021-09-15 15:54:07 +02:00
mirror-top-perms.out iotests: Test mirror-top filter permissions 2021-04-09 18:00:29 +02:00
nbd-qemu-allocation iotests: Improve and rename test 309 to nbd-qemu-allocation 2021-07-12 10:56:41 -05:00
nbd-qemu-allocation.out qemu-img: Make unallocated part of backing chain obvious in map 2021-07-12 11:10:53 -05:00
parallels-read-bitmap iotests: add parallels-read-bitmap test 2021-03-08 14:56:55 +01:00
parallels-read-bitmap.out iotests: add parallels-read-bitmap test 2021-03-08 14:56:55 +01:00
qemu-img-bitmaps qemu-img: Add --skip-broken-bitmaps for 'convert --bitmaps' 2021-07-21 14:14:41 -05:00
qemu-img-bitmaps.out qemu-img: Add --skip-broken-bitmaps for 'convert --bitmaps' 2021-07-21 14:14:41 -05:00
qsd-jobs iotests/qsd-jobs: Filter events in the first test 2021-04-09 18:00:29 +02:00
qsd-jobs.out block: improve permission conflict error message 2021-06-02 14:23:20 +02:00
remove-bitmap-from-backing block: Make blockdev-reopen stable API 2021-07-09 13:19:11 +02:00
remove-bitmap-from-backing.out iotests: add test for removing persistent bitmap from backing file 2021-04-09 18:00:29 +02:00