summaryrefslogtreecommitdiffstats
path: root/tests/qemu-iotests
Commit message (Collapse)AuthorAgeFilesLines
* tests: Use iothreads during iotest 223Eric Blake2019-09-242-2/+5
| | | | | | | | Doing so catches the bugs we just fixed with NBD not properly using correct contexts. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20190920220729.31801-1-eblake@redhat.com>
* nbd/client: Add hint when TLS is missingEric Blake2019-09-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I received an off-list report of failure to connect to an NBD server expecting an x509 certificate, when the client was attempting something similar to this command line: $ ./x86_64-softmmu/qemu-system-x86_64 -name 'blah' -machine q35 -nodefaults \ -object tls-creds-x509,id=tls0,endpoint=client,dir=$path_to_certs \ -device virtio-scsi-pci,id=virtio_scsi_pci0,bus=pcie.0,addr=0x6 \ -drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=none,format=raw,file=nbd:localhost:9000,werror=stop,rerror=stop,tls-creds=tls0 \ -device scsi-hd,id=image1,drive=drive_image1,bootindex=0 qemu-system-x86_64: -drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=none,format=raw,file=nbd:localhost:9000,werror=stop,rerror=stop,tls-creds=tls0: TLS negotiation required before option 7 (go) server reported: Option 0x7 not permitted before TLS The problem? As specified, -drive is trying to pass tls-creds to the raw format driver instead of the nbd protocol driver, but before we get to the point where we can detect that raw doesn't know what to do with tls-creds, the nbd driver has already failed because the server complained. The fix to the broken command line? Pass '...,file.tls-creds=tls0' to ensure the tls-creds option is handed to nbd, not raw. But since the error message was rather cryptic, I'm trying to improve the error message. With this patch, the error message adds a line: qemu-system-x86_64: -drive id=drive_image1,if=none,snapshot=off,aio=threads,cache=none,format=raw,file=nbd:localhost:9000,werror=stop,rerror=stop,tls-creds=tls0: TLS negotiation required before option 7 (go) Did you forget a valid tls-creds? server reported: Option 0x7 not permitted before TLS And with luck, someone grepping for that error message will find this commit message and figure out their command line mistake. Sadly, the only mention of file.tls-creds in our docs relates to an --image-opts use of PSK encryption with qemu-img as the client, rather than x509 certificate encryption with qemu-kvm as the client. CC: Tingting Mao <timao@redhat.com> CC: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20190907172055.26870-1-eblake@redhat.com> [eblake: squash in iotest 233 fix] Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
* Replace '-machine accel=xyz' with '-accel xyz'Thomas Huth2019-09-191-1/+1
| | | | | | | | | | | | | | We've got a separate option to configure the accelerator nowadays, which is shorter to type and the preferred way of specifying an accelerator. Use it in the source and examples to show that it is the favored option. (However, do not touch the places yet which also specify other machine options or multiple accelerators - these are currently still better handled with one single "-machine" statement instead) Signed-off-by: Thomas Huth <thuth@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <20190904052739.22123-1-thuth@redhat.com> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
* qemu-iotests: Add test for bz #1745922Maxim Levitsky2019-09-163-0/+132
| | | | | | | | Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com> Tested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-id: 20190915203655.21638-4-mlevitsk@redhat.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* tests/qemu-iotests: Fix qemu-io related output in 026.out.nocacheVladimir Sementsov-Ogievskiy2019-09-161-84/+84
| | | | | | | | | | | | qemu-io now prefixes its error and warnings with "qemu-io:". 36b9986b08787019e fixed a lot of iotests output but forget about 026.out.nocache. Fix it too. Fixes: 99e98d7c9fc1a1639fad ("qemu-io: Use error_[gs]et_progname()") Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-id: 20190816153015.447957-2-vsementsov@virtuozzo.com Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* tests/qemu-iotests/check: Replace "tests" with "iotests" in final status textThomas Huth2019-09-161-4/+4
| | | | | | | | | | | | | | When running "make check -j8" or something similar, the iotests are running in parallel with the other tests. So when they are printing out "Passed all xx tests" or a similar status message at the end, it might not be quite clear that this message belongs to the iotests, since the output might be mixed with the other tests. Thus change the word "tests" here to "iotests" instead to avoid confusion. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-id: 20190906113920.11271-1-thuth@redhat.com Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* iotests: extend sleeping time under ValgrindAndrey Shinkevich2019-09-131-1/+5
| | | | | | | | | | To synchronize the time when QEMU is running longer under the Valgrind, increase the sleeping time in the test 247. Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: extended timeout under ValgrindAndrey Shinkevich2019-09-133-3/+18
| | | | | | | | | | | | As the iotests run longer under the Valgrind, the QEMU_COMM_TIMEOUT is to be increased in the test cases 028, 183 and 192 when running under the Valgrind. Suggested-by: Roman Kagan <rkagan@virtuozzo.com> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Valgrind fails with nonexistent directoryAndrey Shinkevich2019-09-131-0/+4
| | | | | | | | | | | The Valgrind uses the exported variable TMPDIR and fails if the directory does not exist. Let us exclude such a test case from being run under the Valgrind and notify the user of it. Suggested-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Add casenotrun report to bash testsAndrey Shinkevich2019-09-131-0/+9
| | | | | | | | | | | | | The new function _casenotrun() is to be invoked if a test case cannot be run for some reason. The user will be notified by a message passed to the function. It is the caller's responsibility to make skipped a particular test. Suggested-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: exclude killed processes from running under ValgrindAndrey Shinkevich2019-09-134-2/+18
| | | | | | | | | | | | | | | The Valgrind tool fails to manage its termination in multi-threaded processes when they raise the signal SIGKILL. The bug has been reported to the Valgrind maintainers and was registered as the bug #409141: https://bugs.kde.org/show_bug.cgi?id=409141 Let's exclude such test cases from running under the Valgrind until a new version with the bug fix is released because checking for the memory issues is covered by other test cases. Suggested-by: John Snow <jsnow@redhat.com> Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: allow Valgrind checking all QEMU processesAndrey Shinkevich2019-09-134-58/+78
| | | | | | | | | | | | | | | | | | | | | | With the '-valgrind' option, let all the QEMU processes be run under the Valgrind tool. The Valgrind own parameters may be set with its environment variable VALGRIND_OPTS, e.g. $ VALGRIND_OPTS="--leak-check=yes" ./check -valgrind <test#> or they may be listed in the Valgrind checked file ./.valgrindrc or ~/.valgrindrc like --memcheck:leak-check=no --memcheck:track-origins=yes To exclude a specific process from running under the Valgrind, the corresponding environment variable VALGRIND_QEMU_<name> is to be set to the empty string: $ VALGRIND_QEMU_IO= ./check -valgrind <test#> When QEMU-IO process is being killed, the shell report refers to the text of the command in _qemu_io_wrapper(), which was modified with this patch. So, the benchmark output for the tests 039, 061 and 137 is to be changed also. Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: skip 232 when run tests as rootVladimir Sementsov-Ogievskiy2019-09-101-0/+6
| | | | | | | chmod a-w don't help under root, so skip the test in such case. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Test blockdev-create for vpcMax Reitz2019-09-103-0/+291
| | | | | Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Restrict nbd Python tests to nbdMax Reitz2019-09-102-4/+4
| | | | | | | | | | | | | | | We have two Python unittest-style tests that test NBD. As such, they should specify supported_protocols=['nbd'] so they are skipped when the user wants to test some other protocol. Furthermore, we should restrict their choice of formats to 'raw'. The idea of a protocol/format combination is to use some format over some protocol; but we always use the raw format over NBD. It does not really matter what the NBD server uses on its end, and it is not a useful test of the respective format driver anyway. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Restrict file Python tests to fileMax Reitz2019-09-1026-26/+52
| | | | | | | | | | | | Most of our Python unittest-style tests only support the file protocol. You can run them with any other protocol, but the test will simply ignore your choice and use file anyway. We should let them signal that they require the file protocol so they are skipped when you want to test some other protocol. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Add supported protocols to execute_test()Max Reitz2019-09-101-1/+3
| | | | | Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Test reverse sub-cluster qcow2 writesMax Reitz2019-09-103-0/+74
| | | | | | | | | | | | | | This exercises the regression introduced in commit 50ba5b2d994853b38fed10e0841b119da0f8b8e5. On my machine, it has close to a 50 % false-negative rate, but that should still be sufficient to test the fix. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Stefano Garzarella <sgarzare@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Tested-by: Stefano Garzarella <sgarzare@redhat.com> Tested-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* nbd: Implement server use of NBD FAST_ZEROEric Blake2019-09-052-2/+2
| | | | | | | | | | | The server side is fairly straightforward: we can always advertise support for detection of fast zero, and implement it by mapping the request to the block layer BDRV_REQ_NO_FALLBACK. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20190823143726.27062-5-eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> [eblake: update iotests 223, 233]
* nbd: Improve per-export flag handling in serverEric Blake2019-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating a read-only image, we are still advertising support for TRIM and WRITE_ZEROES to the client, even though the client should not be issuing those commands. But seeing this requires looking across multiple functions: All callers to nbd_export_new() passed a single flag based solely on whether the export allows writes. Later, we then pass a constant set of flags to nbd_negotiate_options() (namely, the set of flags which we always support, at least for writable images), which is then further dynamically modified with NBD_FLAG_SEND_DF based on client requests for structured options. Finally, when processing NBD_OPT_EXPORT_NAME or NBD_OPT_EXPORT_GO we bitwise-or the original caller's flag with the runtime set of flags we've built up over several functions. Let's refactor things to instead compute a baseline of flags as soon as possible which gets shared between multiple clients, in nbd_export_new(), and changing the signature for the callers to pass in a simpler bool rather than having to figure out flags. We can then get rid of the 'myflags' parameter to various functions, and instead refer to client for everything we need (we still have to perform a bitwise-OR for NBD_FLAG_SEND_DF during NBD_OPT_EXPORT_NAME and NBD_OPT_EXPORT_GO, but it's easier to see what is being computed). This lets us quit advertising senseless flags for read-only images, as well as making the next patch for exposing FAST_ZERO support easier to write. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20190823143726.27062-2-eblake@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> [eblake: improve commit message, update iotest 223]
* nbd: Tolerate more errors to structured reply requestEric Blake2019-09-051-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | A server may have a reason to reject a request for structured replies, beyond just not recognizing them as a valid request; similarly, it may have a reason for rejecting a request for a meta context. It doesn't hurt us to continue talking to such a server; otherwise 'qemu-nbd --list' of such a server fails to display all available details about the export. Encountered when temporarily tweaking nbdkit to reply with NBD_REP_ERR_POLICY. Present since structured reply support was first added (commit d795299b reused starttls handling, but starttls is different in that we can't fall back to other behavior on any error). Note that for an unencrypted client trying to connect to a server that requires encryption, this defers the point of failure to when we finally execute a strict command (such as NBD_OPT_GO or NBD_OPT_LIST), now that the intermediate NBD_OPT_STRUCTURED_REPLY does not diagnose NBD_REP_ERR_TLS_REQD as fatal; but as the protocol eventually gets us to a command where we can't continue onwards, the changed error message doesn't cause any security concerns. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20190824172813.29720-3-eblake@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> [eblake: fix iotest 233]
* nbd: Advertise multi-conn for shared read-only connectionsEric Blake2019-09-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The NBD specification defines NBD_FLAG_CAN_MULTI_CONN, which can be advertised when the server promises cache consistency between simultaneous clients (basically, rules that determine what FUA and flush from one client are able to guarantee for reads from another client). When we don't permit simultaneous clients (such as qemu-nbd without -e), the bit makes no sense; and for writable images, we probably have a lot more work before we can declare that actions from one client are cache-consistent with actions from another. But for read-only images, where flush isn't changing any data, we might as well advertise multi-conn support. What's more, advertisement of the bit makes it easier for clients to determine if 'qemu-nbd -e' was in use, where a second connection will succeed rather than hang until the first client goes away. This patch affects qemu as server in advertising the bit. We may want to consider patches to qemu as client to attempt parallel connections for higher throughput by spreading the load over those connections when a server advertises multi-conn, but for now sticking to one connection per nbd:// BDS is okay. See also: https://bugzilla.redhat.com/1708300 Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20190815185024.7010-1-eblake@redhat.com> [eblake: tweak blockdev-nbd.c to not request shared when writable, fix iotest 233] Reviewed-by: John Snow <jsnow@redhat.com>
* iotests: Unify cache mode quotingNir Soffer2019-09-034-7/+7
| | | | | | | | | Quoting cache mode is not needed, and most tests use unquoted values. Unify all test to use the same style. Message-id: 20190827173432.7656-1-nsoffer@redhat.com Signed-off-by: Nir Soffer <nsoffer@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* iotests: Check for enabled drivers before testing themThomas Huth2019-09-038-6/+21
| | | | | | | | | | | | | | | | | | | | | | It is possible to enable only a subset of the block drivers with the "--block-drv-rw-whitelist" option of the "configure" script. All other drivers are marked as unusable (or only included as read-only with the "--block-drv-ro-whitelist" option). If an iotest is now using such a disabled block driver, it is failing - which is bad, since at least the tests in the "auto" group should be able to deal with this situation. Thus let's introduce a "_require_drivers" function that can be used by the shell tests to check for the availability of certain drivers first, and marks the test as "not run" if one of the drivers is missing. This patch mainly targets the test in the "auto" group which should never fail in such a case, but also improves some of the other tests along the way. Note that we also assume that the "qcow2" and "file" drivers are always available - otherwise it does not make sense to run "make check-block" at all (which only tests with qcow2 by default). Signed-off-by: Thomas Huth <thuth@redhat.com> Message-id: 20190823133552.11680-1-thuth@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* iotests: Add -display none to the qemu optionsMax Reitz2019-09-031-3/+3
| | | | | | | | | | | | | Without this argument, qemu will print an angry message about not being able to connect to a display server if $DISPLAY is not set. For me, that breaks iotests.supported_formats() because it thus only sees ["Could", "not", "connect"] as the supported formats. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-id: 20190819201851.24418-2-mreitz@redhat.com Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* iotests: Disable 126 for flat vmdk subformatsMax Reitz2019-09-031-0/+2
| | | | | | | | | | iotest 126 requires backing file support, which flat vmdks cannot offer. Skip this test for such subformats. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20190815153638.4600-8-mreitz@redhat.com Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* iotests: Disable 110 for vmdk.twoGbMaxExtentSparseMax Reitz2019-09-031-1/+2
| | | | | | | | | | | | | | | The error message for the test case where we have a quorum node for which no directory name can be generated is different: For twoGbMaxExtentSparse, it complains that it cannot open the extent file. For other (sub)formats, it just notes that it cannot determine the backing file path. Both are fine, but just disable twoGbMaxExtentSparse for simplicity's sake. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20190815153638.4600-7-mreitz@redhat.com Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* iotests: Disable broken streamOptimized testsMax Reitz2019-09-0321-9/+30
| | | | | | | | | | | streamOptimized does not support writes that do not span exactly one cluster. Furthermore, it cannot rewrite already allocated clusters. As such, many iotests do not work with it. Disable them. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20190815153638.4600-6-mreitz@redhat.com Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* iotests: Keep testing broken relative extent pathsMax Reitz2019-09-032-0/+31
| | | | | | | | | | | | We had a test for a case where relative extent paths did not work, but unfortunately we just fixed the underlying problem, so it works now. This patch adds a new test case that still fails. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20190815153638.4600-4-mreitz@redhat.com Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* vmdk: Use bdrv_dirname() for relative extent pathsMax Reitz2019-09-032-3/+8
| | | | | | | | | | This makes iotest 033 pass with e.g. subformat=monolithicFlat. It also turns a former error in 059 into success. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20190815153638.4600-3-mreitz@redhat.com Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* iotests: Fix _filter_img_create()Max Reitz2019-09-032-10/+10
| | | | | | | | | | | | | fe646693acc changed qemu-img create's output so that it no longer prints single quotes around parameter values. The subformat and adapter_type filters in _filter_img_create() have never been adapted to that change. Fixes: fe646693acc13ac48b98435d14149ab04dc597bc Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 20190815153638.4600-2-mreitz@redhat.com Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* iotests: Test allocate_first_block() with O_DIRECTNir Soffer2019-09-032-0/+36
| | | | | | | | | | | | | | | Using block_resize we can test allocate_first_block() with file descriptor opened with O_DIRECT, ensuring that it works for any size larger than 4096 bytes. Testing smaller sizes is tricky as the result depends on the filesystem used for testing. For example on NFS any size will work since O_DIRECT does not require any alignment. Signed-off-by: Nir Soffer <nsoffer@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190827010528.8818-3-nsoffer@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* block: posix: Always allocate the first blockNir Soffer2019-09-038-21/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating an image with preallocation "off" or "falloc", the first block of the image is typically not allocated. When using Gluster storage backed by XFS filesystem, reading this block using direct I/O succeeds regardless of request length, fooling alignment detection. In this case we fallback to a safe value (4096) instead of the optimal value (512), which may lead to unneeded data copying when aligning requests. Allocating the first block avoids the fallback. Since we allocate the first block even with preallocation=off, we no longer create images with zero disk size: $ ./qemu-img create -f raw test.raw 1g Formatting 'test.raw', fmt=raw size=1073741824 $ ls -lhs test.raw 4.0K -rw-r--r--. 1 nsoffer nsoffer 1.0G Aug 16 23:48 test.raw And converting the image requires additional cluster: $ ./qemu-img measure -f raw -O qcow2 test.raw required size: 458752 fully allocated size: 1074135040 When using format like vmdk with multiple files per image, we allocate one block per file: $ ./qemu-img create -f vmdk -o subformat=twoGbMaxExtentFlat test.vmdk 4g Formatting 'test.vmdk', fmt=vmdk size=4294967296 compat6=off hwversion=undefined subformat=twoGbMaxExtentFlat $ ls -lhs test*.vmdk 4.0K -rw-r--r--. 1 nsoffer nsoffer 2.0G Aug 27 03:23 test-f001.vmdk 4.0K -rw-r--r--. 1 nsoffer nsoffer 2.0G Aug 27 03:23 test-f002.vmdk 4.0K -rw-r--r--. 1 nsoffer nsoffer 353 Aug 27 03:23 test.vmdk I did quick performance test for copying disks with qemu-img convert to new raw target image to Gluster storage with sector size of 512 bytes: for i in $(seq 10); do rm -f dst.raw sleep 10 time ./qemu-img convert -f raw -O raw -t none -T none src.raw dst.raw done Here is a table comparing the total time spent: Type Before(s) After(s) Diff(%) --------------------------------------- real 530.028 469.123 -11.4 user 17.204 10.768 -37.4 sys 17.881 7.011 -60.7 We can see very clear improvement in CPU usage. Signed-off-by: Nir Soffer <nsoffer@redhat.com> Message-id: 20190827010528.8818-2-nsoffer@redhat.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* iotests: Fix 141 when run with qedMax Reitz2019-08-193-7/+12
| | | | | | | | | | | | | | | | | 69f47505ee has changed qcow2 in such a way that the commit job run in test 141 (and 144[1]) returns before it emits the READY event. However, 141 also runs with qed, where the order is still the other way around. Just filter out the {"return": {}} so the test passes for qed again. [1] 144 only runs with qcow2, so it is fine as it is. Suggested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Fixes: 69f47505ee66afaa513305de0c1895a224e52c45 Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20190809185253.17535-1-mreitz@redhat.com Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* iotests: Full mirror to existing non-zero imageMax Reitz2019-08-192-6/+60
| | | | | | | | | | | The result of a sync=full mirror should always be the equal to the input. Therefore, existing images should be treated as potentially non-zero and thus should be explicitly initialized to be zero beforehand. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20190724171239.8764-12-mreitz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* iotests: Test convert -n to pre-filled imageMax Reitz2019-08-192-0/+25
| | | | | | | Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20190724171239.8764-11-mreitz@redhat.com Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* iotests: Convert to preallocated encrypted qcow2Max Reitz2019-08-192-1/+23
| | | | | | | | | | | | | | Add a test case for converting an empty image (which only returns zeroes when read) to a preallocated encrypted qcow2 image. qcow2_has_zero_init() should return 0 then, thus forcing qemu-img convert to create zero clusters. Signed-off-by: Max Reitz <mreitz@redhat.com> Acked-by: Stefano Garzarella <sgarzare@redhat.com> Tested-by: Stefano Garzarella <sgarzare@redhat.com> Message-id: 20190724171239.8764-10-mreitz@redhat.com Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* iotests/257: test traditional sync modesJohn Snow2019-08-172-2/+3128
| | | | | | | | Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190716000117.25219-12-jsnow@redhat.com [Edit 'Bitmap' --> 'bitmap' in 257.out --js] Signed-off-by: John Snow <jsnow@redhat.com>
* block/backup: improve sync=bitmap work estimatesJohn Snow2019-08-162-20/+20
| | | | | | | | | | | | | When making backups based on bitmaps, the work estimate can be more accurate. Update iotests to reflect the new strategy. TOP work estimates are broken, but do not get worse with this commit. That issue is addressed in the following commits instead. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190716000117.25219-7-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
* iotests/257: test API failuresJohn Snow2019-08-162-0/+152
| | | | | | | Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190716000117.25219-6-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
* iotests/257: Refactor backup helpersJohn Snow2019-08-162-120/+128
| | | | | | | | | | | This test needs support for non-bitmap backups and missing or unspecified bitmap sync modes, so rewrite the helpers to be a little more generic. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190716000117.25219-4-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
* iotests/257: add EmulatedBitmap classJohn Snow2019-08-161-49/+75
| | | | | | | | | | | Represent a bitmap with an object that we can mark and clear bits in. This makes it easier to manage partial writes when we don't write a full group's worth of patterns before an error. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190716000117.25219-3-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
* iotests/257: add Pattern classJohn Snow2019-08-161-26/+32
| | | | | | | | | | Just kidding, this is easier to manage with a full class instead of a namedtuple. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190716000117.25219-2-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
* iotests: test bitmap moving inside 254Vladimir Sementsov-Ogievskiy2019-08-162-2/+110
| | | | | | | | | | | | Test persistent bitmap copying with and without removal of original bitmap. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190708220502.12977-4-jsnow@redhat.com [Edited comment "bitmap1" --> "bitmap2" as per review. --js] Signed-off-by: John Snow <jsnow@redhat.com>
* iotests: add test 257 for bitmap-mode backupsJohn Snow2019-08-163-0/+2664
| | | | | | | | Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190709232550.10724-18-jsnow@redhat.com [Removed 'auto' group, as per new testing config guidelines --js] Signed-off-by: John Snow <jsnow@redhat.com>
* iotests: Add virtio-scsi device helperJohn Snow2019-08-165-18/+10Star
| | | | | | | | | Seems that it comes up enough. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190709232550.10724-17-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
* iotests: teach FilePath to produce multiple pathsJohn Snow2019-08-161-10/+24
| | | | | | | | | | | | Use "FilePaths" instead of "FilePath" to request multiple files be cleaned up after we leave that object's scope. This is not crucial; but it saves a little typing. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190709232550.10724-16-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
* iotests: teach run_job to cancel pending jobsJohn Snow2019-08-161-2/+22
| | | | | | | | | | | | run_job can cancel pending jobs to simulate failure. This lets us use the pending callback to issue test commands while the job is open, but then still have the job fail in the end. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190709232550.10724-15-jsnow@redhat.com [Maintainer edit: Merge conflict resolution in run_job] Signed-off-by: John Snow <jsnow@redhat.com>
* iotests: add testing shim for script-style python testsJohn Snow2019-08-161-14/+26
| | | | | | | | | | | | | | | | | | | Because the new-style python tests don't use the iotests.main() test launcher, we don't turn on the debugger logging for these scripts when invoked via ./check -d. Refactor the launcher shim into new and old style shims so that they share environmental configuration. Two cleanup notes: debug was not actually used as a global, and there was no reason to create a class in an inner scope just to achieve default variables; we can simply create an instance of the runner with the values we want instead. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Message-id: 20190709232550.10724-14-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
* iotests: Add test for concurrent stream/commitMax Reitz2019-08-163-0/+197
| | | | | | | | We already have 030 for that in general, but this tests very specific cases of both jobs finishing concurrently. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>