qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iotests/055: Use cache.no-flush for vmdk target
@ 2020-05-05  6:46 Kevin Wolf
  2020-05-05 14:02 ` Eric Blake
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Wolf @ 2020-05-05  6:46 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, qemu-devel

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>
---
 tests/qemu-iotests/055 | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/tests/qemu-iotests/055 b/tests/qemu-iotests/055
index ab90062b99..002706c114 100755
--- a/tests/qemu-iotests/055
+++ b/tests/qemu-iotests/055
@@ -490,7 +490,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()
@@ -501,13 +501,15 @@ 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,
-                              format=self.target_fmt['type'], interface="none")
+                              format=self.target_fmt['type'], 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):
-- 
2.25.3



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iotests/055: Use cache.no-flush for vmdk target
  2020-05-05  6:46 [PATCH] iotests/055: Use cache.no-flush for vmdk target Kevin Wolf
@ 2020-05-05 14:02 ` Eric Blake
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Blake @ 2020-05-05 14:02 UTC (permalink / raw)
  To: Kevin Wolf, qemu-block; +Cc: qemu-devel

On 5/5/20 1:46 AM, Kevin Wolf wrote:
> 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>
> ---
>   tests/qemu-iotests/055 | 11 +++++++----
>   1 file changed, 7 insertions(+), 4 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-05 14:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-05  6:46 [PATCH] iotests/055: Use cache.no-flush for vmdk target Kevin Wolf
2020-05-05 14:02 ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).