From f3adefb2cea1c63b7b198acaef5e40eb4b2d2d39 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Fri, 22 Sep 2017 14:50:12 +0200 Subject: qemu-io: Drop write permissions before read-only reopen qemu-io provides a 'reopen' command that allows switching from writable to read-only access. We need to make sure that we don't try to keep write permissions to a BlockBackend that becomes read-only, otherwise things are going to fail. This requires a bdrv_drain() call because otherwise in-flight AIO write requests could issue new internal requests while the permission has already gone away, which would cause assertion failures. Draining the queue doesn't break AIO requests in any new way, bdrv_reopen() would drain it anyway only a few lines later. Signed-off-by: Kevin Wolf Reviewed-by: Fam Zheng --- tests/qemu-iotests/187.out | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/qemu-iotests/187.out') diff --git a/tests/qemu-iotests/187.out b/tests/qemu-iotests/187.out index 68fb944cd5..30b987f71f 100644 --- a/tests/qemu-iotests/187.out +++ b/tests/qemu-iotests/187.out @@ -12,7 +12,7 @@ Start from read-write wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) -write failed: Operation not permitted +Block node is read-only wrote 65536/65536 bytes at offset 0 64 KiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) *** done -- cgit v1.2.3