summaryrefslogtreecommitdiff
path: root/tests/qemu-iotests
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2014-07-01 16:52:21 +0200
committerMichael Roth <mdroth@linux.vnet.ibm.com>2014-08-07 17:59:15 -0500
commit3c548f670060ffa835fdf26a67d0a7de926ca8c8 (patch)
treeb3add9c868b5b806c0d46887dfd8a1accaff0603 /tests/qemu-iotests
parentd0d83e8fe72acf65d1d126c0ac1b06fb8fd489df (diff)
downloadqemu-3c548f670060ffa835fdf26a67d0a7de926ca8c8.tar.gz
mirror: Fix qiov size for short requests
When mirroring an image of a size that is not a multiple of the mirror job granularity, the last request would have the right nb_sectors argument, but a qiov that is rounded up to the next multiple of the granularity. Don't do this. This fixes a segfault that is caused by raw-posix being confused by this and allocating a buffer with request length, but operating on it with qiov length. [s/Driver/Drive/ in qemu-iotests 041 as suggested by Eric --Stefan] Reported-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Tested-by: Eric Blake <eblake@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> (cherry picked from commit 5a0f6fd5c84573387056e0464a7fc0c6fb70b2dc) Conflicts: tests/qemu-iotests/041.out *updated 041.out to reflect tests missing from 2.0 Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'tests/qemu-iotests')
-rwxr-xr-xtests/qemu-iotests/0415
-rw-r--r--tests/qemu-iotests/041.out4
2 files changed, 7 insertions, 2 deletions
diff --git a/tests/qemu-iotests/041 b/tests/qemu-iotests/041
index ef4f4657cc..ef74be63ec 100755
--- a/tests/qemu-iotests/041
+++ b/tests/qemu-iotests/041
@@ -211,6 +211,11 @@ class TestSingleDriveZeroLength(TestSingleDrive):
test_small_buffer2 = None
test_large_cluster = None
+class TestSingleDriveUnalignedLength(TestSingleDrive):
+ image_len = 1025 * 1024
+ test_small_buffer2 = None
+ test_large_cluster = None
+
class TestMirrorNoBacking(ImageMirroringTestCase):
image_len = 2 * 1024 * 1024 # MB
diff --git a/tests/qemu-iotests/041.out b/tests/qemu-iotests/041.out
index cfa5c0d0e6..802ffaa0c0 100644
--- a/tests/qemu-iotests/041.out
+++ b/tests/qemu-iotests/041.out
@@ -1,5 +1,5 @@
-...................................
+...........................................
----------------------------------------------------------------------
-Ran 35 tests
+Ran 43 tests
OK