aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2020-05-05 08:46:18 +0200
committerKevin Wolf <kwolf@redhat.com>2020-05-08 13:26:35 +0200
commit6a9d73bdd061d9eb7001d38147f73f4b6987f00b (patch)
tree45dc1402cf76606c6df3e0848480edc31862e458 /tests
parent0a82a9273062d05764e3df3637b3aa95ad8291c6 (diff)
downloadqemu-6a9d73bdd061d9eb7001d38147f73f4b6987f00b.zip
qemu-6a9d73bdd061d9eb7001d38147f73f4b6987f00b.tar.gz
qemu-6a9d73bdd061d9eb7001d38147f73f4b6987f00b.tar.bz2
iotests/055: Use cache.no-flush for vmdk target
055 uses the backup block job to create a compressed backup of an $IMGFMT image with both qcow2 and vmdk targets. However, cluster allocation in vmdk is very slow because it flushes the image file after each L2 update. There is no reason why we need this level of safety in this test, so let's disable flushes for vmdk. For the blockdev-backup tests this is achieved by simply adding the cache.no-flush=on to the drive_add() for the target. For drive-backup, the caching flags are copied from the source node, so we'll also add the flag to the source node, even though it is not vmdk. This can make the test run significantly faster (though it doesn't make a difference on tmpfs). In my usual setup it goes from ~45s to ~15s. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <20200505064618.16267-1-kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/qemu-iotests/05511
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/qemu-iotests/055 b/tests/qemu-iotests/055
index 7f8e630..4d3744b 100755
--- a/tests/qemu-iotests/055
+++ b/tests/qemu-iotests/055
@@ -489,7 +489,7 @@ class TestSingleTransaction(iotests.QMPTestCase):
class TestCompressedToQcow2(iotests.QMPTestCase):
image_len = 64 * 1024 * 1024 # MB
- target_fmt = {'type': 'qcow2', 'args': ()}
+ target_fmt = {'type': 'qcow2', 'args': (), 'drive-opts': ''}
def tearDown(self):
self.vm.shutdown()
@@ -500,14 +500,16 @@ class TestCompressedToQcow2(iotests.QMPTestCase):
pass
def do_prepare_drives(self, attach_target):
- self.vm = iotests.VM().add_drive('blkdebug::' + test_img)
+ self.vm = iotests.VM().add_drive('blkdebug::' + test_img,
+ opts=self.target_fmt['drive-opts'])
qemu_img('create', '-f', self.target_fmt['type'], blockdev_target_img,
str(self.image_len), *self.target_fmt['args'])
if attach_target:
self.vm.add_drive(blockdev_target_img,
img_format=self.target_fmt['type'],
- interface="none")
+ interface="none",
+ opts=self.target_fmt['drive-opts'])
self.vm.launch()
@@ -601,7 +603,8 @@ class TestCompressedToQcow2(iotests.QMPTestCase):
class TestCompressedToVmdk(TestCompressedToQcow2):
- target_fmt = {'type': 'vmdk', 'args': ('-o', 'subformat=streamOptimized')}
+ target_fmt = {'type': 'vmdk', 'args': ('-o', 'subformat=streamOptimized'),
+ 'drive-opts': 'cache.no-flush=on'}
@iotests.skip_if_unsupported(['vmdk'])
def setUp(self):