summaryrefslogtreecommitdiffstats
path: root/tests/qemu-iotests
Commit message (Collapse)AuthorAgeFilesLines
* blockdev: Mark {insert, remove}-medium experimentalMax Reitz2015-12-112-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | While in the long term we want throttling to be its own block filter BDS, in the short term we want it to be part of the BB instead of a BDS; even in the long term we may want legacy throttling to be automatically tied to the BB. blockdev-insert-medium and blockdev-remove-medium do not retain throttling information in the BB (deliberately so). Therefore, using them means tying this information to a BDS, which would break the model described above. (The same applies to other flags such as detect_zeroes.) We probably want to move this information to the BB or its own filter BDS before blockdev-{insert,remove}-medium can be considered completely stable. Therefore, mark these functions experimental for the time being. Suggested-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> Acked-by: Markus Armbruster <armbru@redhat.com> Acked-by: Kevin Wolf <kwolf@redhat.com> Message-id: 1449847385-13986-2-git-send-email-mreitz@redhat.com Reviewed-by: Eric Blake <eblake@redhat.com> [PMM: fixed format nit (underlining) in qmp-commands.hx] Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
* iotests: Add regresion test case for write notifier assertion failureFam Zheng2015-12-032-2/+27
| | | | | | | | | | | | The idea is to let the top level bs have a big request alignment with blkdebug, so that the aio_write request issued from monitor will be serialised. This tests that QEMU doesn't crash upon the read request from the backup job's write notifier, which is a very special case of "reentrant" request. Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1448962590-2842-4-git-send-email-famz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* iotests: Add "add_drive_raw" methodFam Zheng2015-12-031-0/+5
| | | | | | | | This offers full manual control over the "-drive" options. Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1448962590-2842-3-git-send-email-famz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* qemu-iotests: Add -nographic when starting QEMU in 119 and 120Fam Zheng2015-11-252-2/+2
| | | | | | | | | Otherwise, a window flashes on my desktop (built with SDL). Add this as other cases have it. Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1448245930-15031-1-git-send-email-famz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* iotests: fix race in 030John Snow2015-11-181-1/+4
| | | | | | | | | | | | | | | | the stop_test case tests that we can resume a block-stream command after it has stopped/paused due to error. We cannot always reliably query it before it finishes after resume, though, so make this a conditional. The important thing is that we are still testing that it has stopped, and that it finishes successfully after we send a resume command. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: make 'stats-interval' an array of ints instead of a stringAlberto Garcia2015-11-171-1/+1
| | | | | | | | | This is the natural JSON representation and prevents us from having to decode the list manually. Signed-off-by: Alberto Garcia <berto@igalia.com> Message-id: 0e3da8fa206f4ab534ae3ce6086e75fe84f1557e.1447665472.git.berto@igalia.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* iotests: Add test for the block device statisticsAlberto Garcia2015-11-123-0/+355
| | | | | | | Signed-off-by: Alberto Garcia <berto@igalia.com> Message-id: 0fb8501bbf3666b3d5d3f67fa899729c88f21baf.1446044838.git.berto@igalia.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: 124 - transactional failure testJohn Snow2015-11-122-4/+130
| | | | | | | | | | | | | | | | | | | | Use a transaction to request an incremental backup across two drives. Coerce one of the jobs to fail, and then re-run the transaction. Verify that no bitmap data was lost due to the partial transaction failure. To support the 'err-cancel' QMP argument name it's necessary for transaction_action() to convert underscores in Python argument names to hyphens for QMP argument names. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1446765200-3054-14-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: add transactional incremental backup testJohn Snow2015-11-122-2/+56
| | | | | | | | | | | | | | | Test simple usage cases for using transactions to create and synchronize incremental backups. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1446765200-3054-3-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Check for quorum support in test 139Alberto Garcia2015-11-111-0/+2
| | | | | | | | | | | The quorum driver is always built in, but it is disabled during run-time if there's no SHA256 support available (see commit e94867e). This patch skips the quorum test in iotest 139 in that case. Signed-off-by: Alberto Garcia <berto@igalia.com> Message-id: 1447172891-20410-1-git-send-email-berto@igalia.com Signed-off-by: Max Reitz <mreitz@redhat.com>
* iotests: Add tests for the x-blockdev-del commandAlberto Garcia2015-11-113-0/+420
| | | | | | | Signed-off-by: Alberto Garcia <berto@igalia.com> Message-id: 57c3b0d4d0c73ddadd19e5bded9492c359cc4568.1446475331.git.berto@igalia.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* qemu-iotests: fix -valgrind option for checkJeff Cody2015-11-116-26/+59
| | | | | | | | | | | | | | | | | | | Commit 934659c switched the iotests to run qemu-io from a bash subshell, in order to catch segfaults. This method is incompatible with the current valgrind_qemu_io() bash function. Move the valgrind usage into the exec subshell in _qemu_io_wrapper(), while making sure the original return value is passed back to the caller. Update test output for tests 039, 061, and 137 as it looks for the specific subshell command when the process is terminated. Reported-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Message-id: 0066fd85d26ca641a1c25135ff2479b7985701cf.1446232490.git.jcody@redhat.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
* qemu-iotests: fix cleanup of background processesJeff Cody2015-11-114-15/+37
| | | | | | | | | | | | | | | | | | | | | Commit 934659c switched the iotests to run qemu and qemu-nbd from a bash subshell, in order to catch segfaults. Unfortunately, this means the process PID cannot be captured via '$!'. We stopped killing qemu and qemu-nbd processes, leaving a lot of orphaned, running qemu processes after executing iotests. Since the process is using exec in the subshell, the PID is the same as the subshell PID. Track these PIDs for cleanup using pidfiles in the $TEST_DIR. Only track the qemu PID, however, if requested - not all usage requires killing the process. Reported-by: John Snow <jsnow@redhat.com> Signed-off-by: Jeff Cody <jcody@redhat.com> Message-id: 9e4f958b3895b7259b98d845bb46f000ba362869.1446232490.git.jcody@redhat.com [mreitz@redhat.com: Replaced '! -z "..."' by '-n "..."'] Signed-off-by: Max Reitz <mreitz@redhat.com>
* block: test 'blockdev-snapshot' using a file BDS as the overlayAlberto Garcia2015-11-112-1/+15
| | | | | | | | | This test checks that it is not possible to create a snapshot if the requested overlay node is a BDS which does not support backing images. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Remove inner quotation marks in iotest 085Alberto Garcia2015-11-111-8/+8
| | | | | | | | | | This patch removes the inner quotation marks in all cases like this: cmd=" ... "${variable}" ... " Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: Test the reopening of overlay_bs in 'block-commit'Alberto Garcia2015-11-112-2/+32
| | | | | | | | | | | | | The 'block-commit' command needs the overlay image of 'top' to be opened in read-write mode in order to update the backing file string. If 'top' is not the active layer or its backing file then its overlay needs to be reopened during the block job. This is a test case for that scenario. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: add tests for the 'blockdev-snapshot' commandAlberto Garcia2015-11-112-8/+128
| | | | | | | Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Add test for change-related QMP commandsMax Reitz2015-11-113-0/+726
| | | | | Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Only create BB if necessaryMax Reitz2015-10-234-18/+71
| | | | | | | | | | | | Tests 071 and 081 test giving references in blockdev-add. It is not necessary to create a BlockBackend here, so omit it. While at it, fix up some blockdev-add invocations in the vicinity (s/raw/$IMGFMT/ in 081, drop the format BDS for blkverify's raw child in 071). Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* blockdev: Allow creation of BDS trees without BBMax Reitz2015-10-232-3/+3
| | | | | | | | | | | | | | | | | | If the "id" field is missing from the options given to blockdev-add, just omit the BlockBackend and create the BlockDriverState tree alone. However, if "id" is missing, "node-name" must be specified; otherwise, the BDS tree would no longer be accessible. Many BDS options which are not parsed by bdrv_open() (like caching) cannot be specified for these BB-less BDS trees yet. A future patch will remove this limitation. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: auto-generated node-namesJeff Cody2015-10-168-7/+20
| | | | | | | | | If a node-name is not specified, automatically generate the node-name. Generated node-names will use the "block" sub-system identifier. Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: qemu-iotests - fix vmdk test 059.outJeff Cody2015-10-161-6/+6
| | | | | | | | | | | In commit fe646693acc13ac48b98435d14149ab04dc597bc, the option printout format changed. This updates the VMDK test 059.out to the correct output. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* throttle: test that snapshots move the throttling configurationAlberto Garcia2015-10-163-0/+75
| | | | | | | | | If a snapshot is performed on a device that has I/O limits they should be moved to the target image (the new active layer). Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: disable core dumps in test 061Alberto Garcia2015-10-162-6/+6
| | | | | | | | | | | | | | | Commit 934659c460 disabled the supression of segmentation faults in bash tests. The new output of test 061, however, assumes that a core dump will be produced if a program aborts. This is not necessarily the case because core dumps can be disabled using ulimit. Since we cannot guarantee that abort() will produce a core dump, we should use SIGKILL instead (that does not produce any) and update the test output accordingly. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Fix test 128 for password-less sudoMax Reitz2015-10-021-1/+8
| | | | | | | | | | | | | | | As of 934659c460d46c948cf348822fda1d38556ed9a4, $QEMU_IO is generally no longer a program name, and therefore "sudo -n $QEMU_IO" will no longer work. Fix this by copying the qemu-io invocation function from common.config, making it use $sudo for invoking $QEMU_IO_PROG, and then use that function instead of $QEMU_IO. Reported-by: Fam Zheng <famz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* tests: Fix test 049 fallout from improved HMP error messagesEric Blake2015-10-021-0/+1
| | | | | | | | | | | Commit 50b7b000 improved HMP error messages, but forgot to update qemu-iotests to match. Reported-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Add test for checking large image filesMax Reitz2015-09-143-0/+83
| | | | | | | | Add a test for checking a qcow2 file with a multiple of 2^32 clusters. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: More qcow2 reopen testsKevin Wolf2015-09-143-0/+188
| | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
* qemu-iotests: Reopen qcow2 with lazy-refcounts changeKevin Wolf2015-09-142-0/+45
| | | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
* typofixes - v4Veres Lajos2015-09-111-1/+1
| | | | | Signed-off-by: Veres Lajos <vlajos@gmail.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* opts: produce valid command line in qemu_opts_printKővágó, Zoltán2015-09-1132-96/+96
| | | | | | | | | | | | | | | | | This will let us print options in a format that the user would actually write it on the command line (foo=bar,baz=asd,etc=def), without prepending a spurious comma at the beginning of the list, or quoting values unnecessarily. This patch provides the following changes: * write and id=, if the option has an id * do not print separator before the first element * do not quote string arguments * properly escape commas (,) for QEMU Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* iotests: Warn if python subprocess is killedMax Reitz2015-09-041-5/+21
| | | | | | | | | | | | Currently, if a subprocess of a python test (i.e. qemu-io, qemu-img, or qemu) receives a signal and is subsequently aborted, this is not logged. This patch makes python tests always check the exit code of these subprocesses, and emit a message if they have been killed. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Do not suppress segfaults in bash testsMax Reitz2015-09-048-31/+67
| | | | | | | | | | | | | | | | | | | | Currently, if a qemu/qemu-io/qemu-img/qemu-nbd invocation receives a segmentation fault, that message is invisible in most cases since the output is generally filtered and bash suppresses the segmentation fault notice for any but the last element of a pipe. Most of the time, the test will then fail anyway because of missing output, but not necessarily (as happened with test 82 recently). Fix this by making the corresponding environment variables point to wrapper functions which execute the respective command in a subshell. Giving options to qemu/qemu-io/qemu-img and path names with spaces were broken for the Python tests; this patch "accidentally" fixes that. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Respect -nodefaults in tests 41 and 55Max Reitz2015-09-042-6/+16
| | | | | | | | | | | While -nodefaults is set in $QEMU_OPTIONS, this is currently (wrongly) ignored for Python iotests. In order to be prepared for when this is fixed, we should explicitly add an IDE CD-ROM drive instead of relying on it being created automatically. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: More options for VM.add_drive()Max Reitz2015-09-041-3/+6
| | | | | | | | | | This patch allows specifying the interface to be used for the drive, and makes specifying a path optional (if the path is None, the "file" option will be omitted, thus creating an empty drive). Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: s390x: fix test 130Bo Tu2015-09-042-6/+6
| | | | | | | | | | | The default device id of hard disk on the s390 platform is "virtio0" which differs to the "ide0-hd0" for the x86 platform. Setting id in the drive definition, ie:"qemu -drive id=testdisk", will be the same on all platforms. Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Bo Tu <tubo@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: s390x: fix test 049, reject negative sizes in QemuOptsBo Tu2015-09-041-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | when creating an image qemu-img enable us specifying the size of the image using -o size=xx options. But when we specify an invalid size such as a negtive size then different platform gives different result. parse_option_size() function in util/qemu-option.c will be called to parse the size, a cast was called in the function to cast the input (saved as a double in the function) size to an unsigned int64 value, when the input is a negtive value or exceeds the maximum of uint64, then the result is undefined. According to C99 6.3.1.4, the result of converting a floating point number to an integer that cannot represent the (integer part of) number is undefined. And sure enough the results are different on x86 and s390. C99 Language spec 6.3.1.4 Real floating and integers: the result of this assignment/cast is undefined if the float is not in the open interval (-1, U<type>_MAX+1). Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Signed-off-by: Bo Tu <tubo@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: s390x: fix test 041 and 055Bo Tu2015-09-042-0/+15
| | | | | | | | | | | There is no 'ide-cd' device defined on non-pc platform, so test_medium_not_found() test should be skipped. Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Michael Mueller <mimu@linux.vnet.ibm.com> Reviewed-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Signed-off-by: Xiao Guang Chen <chenxg@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: disable default qemu devices for cross-platform compatibilityBo Tu2015-09-047-288/+7
| | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes an io test suite issue that was introduced with the commit c88930a6866e74953e931ae749781e98e486e5c8 'qemu-char: Permit only a single "stdio" character device'. The option supresses the creation of default devices such as the floopy and cdrom. Output files for test case 067, 071, 081 and 087 need to be updated to accommodate this change. Use virtio-blk instead of virtio-blk-pci as the device driver for test case 067. For virtio-blk-pci is the same with virtio-blk as device driver but other platform such as s390 may not recognize the virtio-blk-pci. The default devices differ across machines. As the qemu output often contains these devices (or events for them, like opening a CD tray on reset), the reference output currently is rather machine-specific. All existing qemu tests explicitly configure the devices they're working with, so just pass -nodefaults to qemu by default to disable the default devices. Update the reference outputs accordingly. Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Michael Mueller <mimu@linux.vnet.ibm.com> Reviewed-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Signed-off-by: Xiao Guang Chen <chenxg@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: qemu machine type supportBo Tu2015-09-043-1/+16
| | | | | | | | | | | | | | | This patch adds qemu machine type support to the io test suite. Based on the qemu default machine type and alias of the default machine type the reference output file can now vary from the default to a machine specific output file if necessary. When using a machine specific reference file if the default machine has an alias then use the alias as the output file name otherwise use the default machine name as the output file name. Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Michael Mueller <mimu@linux.vnet.ibm.com> Reviewed-by: Sascha Silbe <silbe@linux.vnet.ibm.com> Signed-off-by: Xiao Guang Chen <chenxg@linux.vnet.ibm.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: qemu-iotests - add check for multiplication overflow in vpcJeff Cody2015-07-274-0/+60
| | | | | | | | | | | | This checks that VPC is able to successfully fail (without segfault) on an image file with a max_table_entries that exceeds 0x40000000. This table entry is within the valid range for VPC (although too large for this sample image). Cc: qemu-stable@nongnu.org Signed-off-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: Use event_wait in wait_readyFam Zheng2015-07-021-7/+2
| | | | | | | | | | Only poll the specific type of event we are interested in, to avoid stealing events that should be consumed by someone else. Suggested-by: John Snow <jsnow@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* qemu-iotests: Add test case for mirror with unmapFam Zheng2015-07-023-0/+65
| | | | | | | | | This checks that the discard on mirror source that effectively zeroes data is also reflected by the data of target. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* qemu-iotests: Make block job methods commonFam Zheng2015-07-022-51/+43
| | | | | | | Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* qapi: Rename 'dirty-bitmap' mode to 'incremental'John Snow2015-07-021-3/+3
| | | | | | | | | | | | | | | If we wish to make differential backups a feature that's easy to access, it might be pertinent to rename the "dirty-bitmap" mode to "incremental" to make it clear what /type/ of backup the dirty-bitmap is helping us perform. This is an API breaking change, but 2.4 has not yet gone live, so we have this flexibility. Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1433463642-21840-2-git-send-email-jsnow@redhat.com Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* qemu-iotests: fix 051.out after qdev error message changeStefan Hajnoczi2015-06-241-8/+0
| | | | | | | | | | | | | | | | Commit f006cf7fa9a63ba8e4ccf57d46231ce594301727 ("qdev-monitor: Propagate errors through qdev_device_add()") dropped a meaningless error message. This change in output caused qemu-iotests 051 to fail: QEMU_PROG: -device ide-drive,drive=disk: Device initialization failed. -QEMU_PROG: -device ide-drive,drive=disk: Device 'ide-drive' could not be initialized Update 051.out so the test passes again. Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Message-id: 1435071369-30936-1-git-send-email-stefanha@redhat.com
* Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into stagingPeter Maydell2015-06-1511-6/+172
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Block layer core and image format patches # gpg: Signature made Fri Jun 12 16:08:53 2015 BST using RSA key ID C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" * remotes/kevin/tags/for-upstream: (25 commits) block: Fix reopen flag inheritance block: Add BlockDriverState.inherits_from block: Add list of children to BlockDriverState queue.h: Add QLIST_FIX_HEAD_PTR() block: Drain requests before swapping nodes in bdrv_swap() block: Move flag inheritance to bdrv_open_inherit() block: Use QemuOpts in bdrv_open_common() block: Use macro for cache option names vmdk: Use bdrv_open_image() quorum: Use bdrv_open_image() check-qdict: Test cases for new functions qdict: Add qdict_{set,copy}_default() qdict: Add qdict_array_entries() iotests: Add tests for overriding BDRV_O_PROTOCOL block: driver should override flags in bdrv_open() block: Change bitmap truncate conditional to assertion block: record new size in bdrv_dirty_bitmap_truncate raw-posix: Fix .bdrv_co_get_block_status() for unaligned image size vmdk: Use vmdk_find_index_in_cluster everywhere vmdk: Fix index_in_cluster calculation in vmdk_co_get_block_status ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * iotests: Add tests for overriding BDRV_O_PROTOCOLMax Reitz2015-06-125-0/+153
| | | | | | | | | | | | | | | | | | | | This adds tests for overriding the qemu-internal BDRV_O_PROTOCOL flag by explicitly specifying a block driver. As one test must be run over the NBD protocol while the other must not, this patch adds two separate iotests. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * block: driver should override flags in bdrv_open()Max Reitz2015-06-122-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The BDRV_O_PROTOCOL flag should have an impact only if no driver is specified explicitly. Therefore, if bdrv_open() is called with an explicit block driver argument (either through the options QDict or through the drv parameter) and that block driver is a protocol block driver, BDRV_O_PROTOCOL should be set; if it is a format block driver, BDRV_O_PROTOCOL should be unset. While there was code to unset the flag in case a format block driver has been selected, it only followed the bdrv_fill_options() function call whereas the flag in fact needs to be adjusted before it is used there. With that change, BDRV_O_PROTOCOL will always be set if the BDS should be a protocol driver; if the driver has been specified explicitly, the new code will set it; and bdrv_fill_options() will only "probe" a protocol driver if BDRV_O_PROTOCOL is set. The probing after bdrv_fill_options() cannot select a protocol driver. Thus, bdrv_open_image() to open BDS.file is never called if a protocol BDS is about to be created. With that change in turn it is impossible to call bdrv_open_common() with a protocol drv and file != NULL, which allows us to remove the bdrv_swap() call. This change breaks a test case in qemu-iotest 051: "-drive file=t.qcow2,file.driver=qcow2" now works because the explicitly specified "qcow2" overrides the BDRV_O_PROTOCOL which is automatically set for the "file" BDS (and the filename is just passed down). Therefore, this patch removes that test case. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
| * iotests: qcow2 COW with minimal L2 cache sizeMax Reitz2015-06-122-0/+15
| | | | | | | | | | | | | | | | | | | | | | This adds a test case to test 103 for performing a COW operation in a qcow2 image using an L2 cache with minimal size (which should be at least two clusters so the COW can access both source and destination simultaneously). Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
OpenPOWER on IntegriCloud