During my quest to switch block status to be byte-based, John forced me to evaluate whether we have a situation during copy-on-read where we could exceed BDRV_REQUEST_MAX_BYTES [1]. Sure enough, we have a number of pre-existing bugs in the copy-on-read code. Fix those (patch 3), along with adding a test (patch 4, but needs a couple of additions in patch 1 and 2 to make the test even possible). Swapping patch 3 and 4 demonstrates that the test indeed exposes flaws.
[1] https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg07286.html Eric Blake (4): qemu-io: Add -C for opening with copy-on-read block: Add blkdebug hook for copy-on-read block: Perform copy-on-read in loop iotests: Add test 197 for covering copy-on-read qapi/block-core.json | 5 +- block/io.c | 118 +++++++++++++++++++++++++++------------ qemu-io.c | 15 ++++- tests/qemu-iotests/common.filter | 1 + tests/qemu-iotests/197 | 93 ++++++++++++++++++++++++++++++ tests/qemu-iotests/197.out | 24 ++++++++ tests/qemu-iotests/group | 1 + 7 files changed, 216 insertions(+), 41 deletions(-) create mode 100755 tests/qemu-iotests/197 create mode 100644 tests/qemu-iotests/197.out -- 2.13.6