[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 17/29] qemu-iotests: Test qcow2 not leaking clusters
From: |
Kevin Wolf |
Subject: |
[Qemu-block] [PULL 17/29] qemu-iotests: Test qcow2 not leaking clusters on write error |
Date: |
Fri, 29 Jun 2018 16:09:47 +0200 |
This adds a test for a temporary write failure, which simulates the
situation after werror=stop/enospc has stopped the VM. We shouldn't
leave leaked clusters behind in such cases.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/026 | 17 +++++++++++++++++
tests/qemu-iotests/026.out | 8 ++++++++
tests/qemu-iotests/026.out.nocache | 8 ++++++++
3 files changed, 33 insertions(+)
diff --git a/tests/qemu-iotests/026 b/tests/qemu-iotests/026
index 7fadfbace5..582d254195 100755
--- a/tests/qemu-iotests/026
+++ b/tests/qemu-iotests/026
@@ -200,6 +200,23 @@ done
done
done
+echo
+echo === Avoid cluster leaks after temporary failure ===
+echo
+
+cat > "$TEST_DIR/blkdebug.conf" <<EOF
+[inject-error]
+event = "write_aio"
+errno = "5"
+once = "on"
+EOF
+
+# After the failed first write, do a second write so that the updated refcount
+# block is actually written back
+_make_test_img 64M
+$QEMU_IO -c "write 0 1M" -c "write 0 1M" "$BLKDBG_TEST_IMG" | _filter_qemu_io
+_check_test_img
+
# success, all done
echo "*** done"
rm -f $seq.full
diff --git a/tests/qemu-iotests/026.out b/tests/qemu-iotests/026.out
index 8e89416a86..dd10a82b51 100644
--- a/tests/qemu-iotests/026.out
+++ b/tests/qemu-iotests/026.out
@@ -675,4 +675,12 @@ write failed: No space left on device
96 leaked clusters were found on the image.
This means waste of disk space, but no harm to data.
+
+=== Avoid cluster leaks after temporary failure ===
+
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+write failed: Input/output error
+wrote 1048576/1048576 bytes at offset 0
+1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+No errors were found on the image.
*** done
diff --git a/tests/qemu-iotests/026.out.nocache
b/tests/qemu-iotests/026.out.nocache
index 650ccd8b01..1ca6cda15c 100644
--- a/tests/qemu-iotests/026.out.nocache
+++ b/tests/qemu-iotests/026.out.nocache
@@ -683,4 +683,12 @@ write failed: No space left on device
96 leaked clusters were found on the image.
This means waste of disk space, but no harm to data.
+
+=== Avoid cluster leaks after temporary failure ===
+
+Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864
+write failed: Input/output error
+wrote 1048576/1048576 bytes at offset 0
+1 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
+No errors were found on the image.
*** done
--
2.13.6
- [Qemu-block] [PULL 08/29] qcow2: Remove coroutine trampoline for preallocate_co(), (continued)
- [Qemu-block] [PULL 08/29] qcow2: Remove coroutine trampoline for preallocate_co(), Kevin Wolf, 2018/06/29
- [Qemu-block] [PULL 06/29] qcow2: Fix qcow2_truncate() error return value, Kevin Wolf, 2018/06/29
- [Qemu-block] [PULL 10/29] block: Use tracked request for truncate, Kevin Wolf, 2018/06/29
- [Qemu-block] [PULL 07/29] block: Convert .bdrv_truncate callback to coroutine_fn, Kevin Wolf, 2018/06/29
- [Qemu-block] [PULL 11/29] file-posix: Make .bdrv_co_truncate asynchronous, Kevin Wolf, 2018/06/29
- [Qemu-block] [PULL 09/29] block: Move bdrv_truncate() implementation to io.c, Kevin Wolf, 2018/06/29
- [Qemu-block] [PULL 13/29] block: Move request tracking to children in copy offloading, Kevin Wolf, 2018/06/29
- [Qemu-block] [PULL 12/29] qcow2: Remove dead check on !ret, Kevin Wolf, 2018/06/29
- [Qemu-block] [PULL 14/29] block/crypto: Simplify block_crypto_{open, create}_opts_init(), Kevin Wolf, 2018/06/29
- [Qemu-block] [PULL 16/29] qcow2: Free allocated clusters on write error, Kevin Wolf, 2018/06/29
- [Qemu-block] [PULL 17/29] qemu-iotests: Test qcow2 not leaking clusters on write error,
Kevin Wolf <=
- [Qemu-block] [PULL 18/29] file-posix: Implement co versions of discard/flush, Kevin Wolf, 2018/06/29
- [Qemu-block] [PULL 15/29] qemu-iotests: Update 026.out.nocache reference output, Kevin Wolf, 2018/06/29
- [Qemu-block] [PULL 24/29] qcow: Switch qcow_co_readv to byte-based calls, Kevin Wolf, 2018/06/29
- [Qemu-block] [PULL 21/29] file-posix: Fix EINTR handling, Kevin Wolf, 2018/06/29
- [Qemu-block] [PULL 20/29] iscsi: Don't blindly use designator length in response for memcpy, Kevin Wolf, 2018/06/29
- [Qemu-block] [PULL 22/29] parallels: Switch to byte-based calls, Kevin Wolf, 2018/06/29
- [Qemu-block] [PULL 23/29] qcow: Switch get_cluster_offset to be byte-based, Kevin Wolf, 2018/06/29
- [Qemu-block] [PULL 19/29] qcow2: Fix src_offset in copy offloading, Kevin Wolf, 2018/06/29
- [Qemu-block] [PULL 26/29] qcow: Switch to a byte-based driver, Kevin Wolf, 2018/06/29
- [Qemu-block] [PULL 25/29] qcow: Switch qcow_co_writev to byte-based calls, Kevin Wolf, 2018/06/29