bdrv_reopen() can switch nodes between read-only and read-write modes. This has implications for the required permissions on their child nodes. For example, a qcow2 node requests write permissions on bs->file only if it is writable itself.
This means that during bdrv_reopen(), the permissions need to be recalculated in order to prevent failures where the bs->file permissions don't match its actual read-only state (e.g. bs->file is a read-write node, but the permission still enforces read-only access). Kevin Wolf (6): qemu-io: Reset qemuio_blk permissions before each command block: Add reopen_queue to bdrv_child_perm() block: Add reopen queue to bdrv_check_perm() block: Base permissions on rw state after reopen block: reopen: Queue children after their parents block: Fix permissions after bdrv_reopen() include/block/block.h | 2 +- include/block/block_int.h | 7 ++ block.c | 191 +++++++++++++++++++++++++++++++++------------ block/commit.c | 1 + block/mirror.c | 1 + block/replication.c | 1 + block/vvfat.c | 1 + qemu-io.c | 13 +++ tests/qemu-iotests/187.out | 2 +- 9 files changed, 169 insertions(+), 50 deletions(-) -- 2.13.5