summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2018-04-03Merge remote-tracking branch 'mreitz/tags/pull-block-2018-04-03' into ↵Kevin Wolf6-2/+117
queue-block A fix for preallocated truncation, a new iotest, and a fix to make the iotests work more comfortably on ppc64 # gpg: Signature made Tue Apr 3 17:40:57 2018 CEST # gpg: using RSA key F407DB0061D5CF40 # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1 1829 F407 DB00 61D5 CF40 * mreitz/tags/pull-block-2018-04-03: iotests: Test abnormally large size in compressed cluster descriptor qemu-iotests: Use ppc64 qemu_arch on ppc64le host iotests: Test preallocated truncate of 2G image block/file-posix: Fix fully preallocated truncate Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-04-03iotests: Test abnormally large size in compressed cluster descriptorAlberto Garcia2-0/+80
L2 entries for compressed clusters have a field that indicates the number of sectors used to store the data in the image. That's however not the size of the compressed data itself, just the number of sectors where that data is located. The actual data size is usually not a multiple of the sector size, and therefore cannot be represented with this field. The way it works is that QEMU reads all the specified sectors and starts decompressing the data until there's enough to recover the original uncompressed cluster. If there are any bytes left that haven't been decompressed they are simply ignored. One consequence of this is that even if the size field is larger than it needs to be QEMU can handle it just fine: it will read more data from disk but it will ignore the extra bytes. This test creates an image with two compressed clusters that use 5 sectors (2.5 KB) each, increases the size field to the maximum (8192 sectors, or 4 MB) and verifies that the data can be read without problems. This test is important because while the decompressed data takes exactly one cluster, the maximum value allowed in the compressed size field is twice the cluster size. So although QEMU won't produce images with such large values we need to make sure that it can handle them. Another effect of increasing the size field is that it can make it include data from the following host cluster(s). In this case 'qemu-img check' will detect that the refcounts are not correct, and we'll need to rebuild them. Additionally, this patch also tests that decreasing the size corrupts the image since the original data can no longer be recovered. In this case QEMU returns an error when trying to read the compressed data, but 'qemu-img check' doesn't see anything wrong if the refcounts are consistent. One possible task for the future is to make 'qemu-img check' verify the sizes of the compressed clusters, by trying to decompress the data and checking that the size stored in the L2 entry is correct. Signed-off-by: Alberto Garcia <berto@igalia.com> Message-id: 20180329120745.11154-1-berto@igalia.com Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2018-04-03qemu-iotests: Use ppc64 qemu_arch on ppc64le hostLukáš Doktor2-2/+3
The qemu target does not always correspond to the host machine type. For example ppc64le machine target is ppc64. Let's introduce "qemu_arch" variable to store the matching qemu architecture related to the current architecture and use it when auto-detecting the default qemu binary. Signed-off-by: Lukáš Doktor <ldoktor@redhat.com> Message-id: 20180329112053.5399-2-ldoktor@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2018-04-03iotests: Test preallocated truncate of 2G imageMax Reitz2-0/+34
Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20180228131315.30194-3-mreitz@redhat.com Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2018-04-03iotests: fix 208 for luks formatVladimir Sementsov-Ogievskiy1-1/+1
Support luks images creatins like in 205 Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-04-03iotests: Update 186 after commit ac64273c66ab136c44043259162Alberto Garcia3-29/+34
Commit ac64273c66ab136c44 modified the output of iotest 186, changing the QOM path of floppy drives from /machine/unattached/device[17] to /machine/unattached/device[13]. Instead of updating the test output to reflect this change, this patch adds a new filter that hides all QOM paths from the 'Attached to:' line of the 'info block' command. Signed-off-by: Alberto Garcia <berto@igalia.com> Cc: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-04-03iotests: Update 051 and 186 after commit 1454509726719e0933cAlberto Garcia3-52/+0
SCSI controllers are no longer created automatically for -drive if=scsi, so this patch updates the tests that relied on that. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Eric Blake <eblake@redhat.com> Cc: Thomas Huth <thuth@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-03-29tests: Tests more flags of the CRB interfaceStefan Berger1-2/+72
Test and modify more flags of the CRB interface. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2018-03-27Merge remote-tracking branch 'remotes/ericb/tags/pull-qapi-2018-03-27-v2' ↵Peter Maydell16-24/+126
into staging qapi patches for 2018-03-27, 2.12-rc1 - Marc-André Lureau: qmp-test: fix response leak - Eric Blake: tests: Silence false positive warning on generated test name - Laurent Vivier: 0/4 (partial) coccinelle: re-run scripts from scripst/coccinelle - Peter Xu: 0/8 Monitor: some oob related patches (fixes, new param, tests) - Satheesh Rajendran: hmp.c: Revert hmp_info_cpus output format change # gpg: Signature made Tue 27 Mar 2018 16:18:36 BST # gpg: using RSA key A7A16B4A2527436A # gpg: Good signature from "Eric Blake <eblake@redhat.com>" # gpg: aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" # gpg: aka "[jpeg image of size 6874]" # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2 F3AA A7A1 6B4A 2527 436A * remotes/ericb/tags/pull-qapi-2018-03-27-v2: hmp.c: Revert hmp_info_cpus output format change tests: qmp-test: add test for new "x-oob" tests: Add parameter to qtest_init_without_qmp_handshake monitor: new parameter "x-oob" qmp: cleanup qmp queues properly tests: add oob-test for qapi-schema tests: let qapi-schema tests detect oob qapi: restrict allow-oob value to be "true" qmp: fix qmp_capabilities error regression qdict: remove useless cast error: Remove NULL checks on error_propagate() calls error: Strip trailing '\n' from error string arguments (again again) tests: Silence false positive warning on generated test name qmp-test: fix response leak Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-03-27Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into ↵Peter Maydell1-12/+51
staging # gpg: Signature made Tue 27 Mar 2018 15:41:11 BST # gpg: using RSA key 9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/block-pull-request: MAINTAINERS: add include/block/aio-wait.h coroutine: add test-aio coroutine queue chaining test case coroutine: avoid co_queue_wakeup recursion queue: add QSIMPLEQ_PREPEND() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-03-27tests: qmp-test: add test for new "x-oob"Peter Xu1-0/+82
Test the new OOB capability. It's mostly the reverted OOB test (see commit 4fd78ad7), but differs in that: - It uses the new qtest_init_without_qmp_handshake() parameter to create the monitor with "x-oob" - Squashed the capability tests on greeting message - Don't use qtest_global any more, instead use self-maintained QTestState, which is the trend Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180326063901.27425-9-peterx@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [eblake: rebase to qtest_init changes] Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Tested-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Eric Blake <eblake@redhat.com>
2018-03-27tests: Add parameter to qtest_init_without_qmp_handshakeEric Blake3-7/+12
Allow callers to choose whether to allow OOB support during a test; for now, all existing callers pass false, but the next patch will add a new caller. Also, rewrite the monitor setup to be generic (using the -qmp shorthand is insufficient for honoring the parameter). Based on an idea by Peter Xu, in <20180326063901.27425-8-peterx@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20180327013620.1644387-4-eblake@redhat.com> Tested-by: Christian Borntraeger <borntraeger@de.ibm.com> Acked-by: Peter Xu <peterx@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2018-03-27tests: add oob-test for qapi-schemaPeter Xu8-0/+14
It simply tests the new OOB capability, and make sure the QAPISchema can parse it correctly. Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180326063901.27425-7-peterx@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
2018-03-27tests: let qapi-schema tests detect oobPeter Xu5-16/+16
The allow_oob parameter was passed in but not used in tests. Now reflect that in the tests, so we need to touch up other command testers with that new change. Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180326063901.27425-6-peterx@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
2018-03-27tests: Silence false positive warning on generated test nameEric Blake1-1/+1
Running 'make check' on rawhide with gcc 8.0.1 fails: tests/test-visitor-serialization.c: In function 'main': tests/test-visitor-serialization.c:1127:34: error: '/primitives/' directive writing 12 bytes into a region of size between 1 and 128 [-Werror=format-overflow=] The warning is a false positive (we have two buffers of size 128, so yes, if we FULLY used the first buffer, then sprint'ing it into the second will overflow the second). But in practice, our first buffer will not be longer than "/visitor/serialization/String", so sizing it smaller is enough to let gcc see that we don't overflow the second. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20180323204341.1501664-1-eblake@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2018-03-27qmp-test: fix response leakMarc-André Lureau1-0/+1
Apparently introduced in commit a4f90923b520f1dc0a768634877eb412e5052c26. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20180326172041.21009-1-marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
2018-03-27Merge remote-tracking branch 'remotes/xtensa/tags/20180326-xtensa' into stagingPeter Maydell1-1/+1
target/xtensa fixes for 2.12: - add .inc. to non-top level source file names under target/xtensa; - fix #include <xtensa-isa.h> in the import_core.sh script; - remove stray linux-user/xtensa/syscall.h; - fix timers test. # gpg: Signature made Mon 26 Mar 2018 22:40:20 BST # gpg: using RSA key 51F9CC91F83FA044 # gpg: Good signature from "Max Filippov <filippov@cadence.com>" # gpg: aka "Max Filippov <max.filippov@cogentembedded.com>" # gpg: aka "Max Filippov <jcmvbkbc@gmail.com>" # Primary key fingerprint: 2B67 854B 98E5 327D CDEB 17D8 51F9 CC91 F83F A044 * remotes/xtensa/tags/20180326-xtensa: target/xtensa: fix timers test linux-user/xtensa: remove stray syscall.h target/xtensa/import_core.sh: fix #include <xtensa-isa.h> target/xtensa: add .inc. to non-top level source file names Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-03-27Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2018-03-26' ↵Peter Maydell2-7/+5
into staging A fix for dirty bitmap migration through shared storage, and a VMDK patch keeping us from creating too large extents. # gpg: Signature made Mon 26 Mar 2018 21:17:05 BST # gpg: using RSA key F407DB0061D5CF40 # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1 1829 F407 DB00 61D5 CF40 * remotes/maxreitz/tags/pull-block-2018-03-26: vmdk: return ERROR when cluster sector is larger than vmdk limitation iotests: enable shared migration cases in 169 qcow2: fix bitmaps loading when bitmaps already exist qcow2-bitmap: add qcow2_reopen_bitmaps_rw_hint() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-03-27coroutine: add test-aio coroutine queue chaining test caseStefan Hajnoczi1-12/+51
Check that two coroutines can queue each other repeatedly without hitting stack exhaustion. Switch to qemu_init_main_loop() in main() because coroutines use qemu_get_aio_context() - they don't know about test-aio's ctx variable. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Message-id: 20180322152834.12656-4-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2018-03-26target/xtensa: fix timers testMax Filippov1-1/+1
The value of CCOUNT special register is calculated as time elapsed since CCOUNT == 0 multiplied by the core frequency. In icount mode time increment between consecutive instructions that don't involve time warps is constant, but unless the result of multiplication of this constant by the core frequency is a whole number the CCOUNT increment between these instructions may not be constant. E.g. with icount=7 each instruction takes 128ns, with core clock of 10MHz CCOUNT values for consecutive instructions are: 502: (128 * 502 * 10000000) / 1000000000 = 642.56 503: (128 * 503 * 10000000) / 1000000000 = 643.84 504: (128 * 504 * 10000000) / 1000000000 = 645.12 I.e.the CCOUNT increments depend on the absolute time. This results in varying CCOUNT differences for consecutive instructions in tests that involve time warps and don't set CCOUNT explicitly. Change frequency of the core used in tests so that clock cycle takes exactly 64ns. Change icount power used in tests to 6, so that each instruction takes exactly 1 clock cycle. With these changes CCOUNT increments only depend on the number of executed instructions and that's what timer tests expect, so they work correctly. Longer story: http://lists.nongnu.org/archive/html/qemu-devel/2018-03/msg04326.html Cc: Pavel Dovgaluk <Pavel.Dovgaluk@ispras.ru> Cc: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2018-03-26iotests: enable shared migration cases in 169Vladimir Sementsov-Ogievskiy2-7/+5
Shared migration for dirty bitmaps is fixed by previous patches, so we can enable the test. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Message-id: 20180320170521.32152-5-vsementsov@virtuozzo.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2018-03-26Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into stagingPeter Maydell13-5/+1348
Block layer patches # gpg: Signature made Mon 26 Mar 2018 15:33:01 BST # gpg: using RSA key 7F09B272C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6 * remotes/kevin/tags/for-upstream: qemu-iotests: Test vhdx image creation with QMP vhdx: Check for 4 GB maximum log size on creation vhdx: Don't use error_setg_errno() with constant errno vhdx: Require power-of-two block size on create qemu-iotests: Test parallels image creation with QMP parallels: Check maximum cluster size on create qemu-iotests: Test invalid resize on luks luks: Turn another invalid assertion into check qemu-iotests: Enable 025 for luks qemu-iotests: Test vdi image creation with QMP vdi: Fix build with CONFIG_VDI_DEBUG vdi: Change 'static' create option to 'preallocation' in QMP qcow2: Reset free_cluster_index when allocating a new refcount block include/block/block_int: Document protocol related functions block/blkreplay: Remove protocol-related fields block/throttle: Remove protocol-related fields block/quorum: Remove protocol-related fields block/replication: Remove protocol_name field iotests: 163 is not quick Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-03-26vhost-user-test: add back memfd checkMarc-André Lureau1-27/+66
This revert commit fb68096da3d35e64c88cd610c1fa42766c58e92a, and modify test_read_guest_mem() to use different chardev names, when using memfd (_test_server_free(), where the chardev is removed, runs in idle). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20180215212552.26997-4-marcandre.lureau@redhat.com> Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2018-03-26vhost-user-test: do not hang if chardev creation failedMarc-André Lureau1-0/+1
Before the chardev name fix, the following error may happen: "attempt to add duplicate property 'chr-test' to object (type 'container')", due to races. Sadly, error_vprintf() uses g_test_message(), so you have to use read the cryptic --debug-log to see it. Later, it would make sense to use g_critical() instead, and catch errors with g_test_expect_message() (in glib 2.34). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20180215212552.26997-5-marcandre.lureau@redhat.com> Acked-by: Maxime Coquelin <maxime.coquelin@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2018-03-26qemu-iotests: Test vhdx image creation with QMPKevin Wolf3-0/+471
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-03-26qemu-iotests: Test parallels image creation with QMPKevin Wolf3-0/+438
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-03-26qemu-iotests: Test invalid resize on luksKevin Wolf2-0/+53
This tests that the .bdrv_truncate implementation for luks doesn't crash for invalid image sizes. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2018-03-26qemu-iotests: Enable 025 for luksKevin Wolf1-1/+8
We want to test resizing even for luks. The only change that is needed is to explicitly zero out new space for luks because it's undefined. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-03-26qemu-iotests: Test vdi image creation with QMPKevin Wolf3-0/+344
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2018-03-26qcow2: Reset free_cluster_index when allocating a new refcount blockAlberto Garcia3-3/+33
When we try to allocate new clusters we first look for available ones starting from s->free_cluster_index and once we find them we increase their reference counts. Before we get to call update_refcount() to do this last step s->free_cluster_index is already pointing to the next cluster after the ones we are trying to allocate. During update_refcount() it may happen however that we also need to allocate a new refcount block in order to store the refcounts of these new clusters (and to complicate things further that may also require us to grow the refcount table). After all this we don't know if the clusters that we originally tried to allocate are still available, so we return -EAGAIN to ask the caller to restart the search for free clusters. This is what can happen in a common scenario: 1) We want to allocate a new cluster and we see that cluster N is free. 2) We try to increase N's refcount but all refcount blocks are full, so we allocate a new one at N+1 (where s->free_cluster_index was pointing at). 3) Once we're done we return -EAGAIN to look again for a free cluster, but now s->free_cluster_index points at N+2, so that's the one we allocate. Cluster N remains unallocated and we have a hole in the qcow2 file. This can be reproduced easily: qemu-img create -f qcow2 -o cluster_size=512 hd.qcow2 1M qemu-io -c 'write 0 124k' hd.qcow2 After this the image has 132608 bytes (256 clusters), and the refcount block is full. If we write 512 more bytes it should allocate two new clusters: the data cluster itself and a new refcount block. qemu-io -c 'write 124k 512' hd.qcow2 However the image has now three new clusters (259 in total), and the first one of them is empty (and unallocated): dd if=hd.qcow2 bs=512c skip=256 count=1 | hexdump -C If we write larger amounts of data in the last step instead of the 512 bytes used in this example we can create larger holes in the qcow2 file. What this patch does is reset s->free_cluster_index to its previous value when alloc_refcount_block() returns -EAGAIN. This way the caller will try to allocate again the original clusters if they are still free. The output of iotest 026 also needs to be updated because now that images have no holes some tests fail at a different point and the number of leaked clusters is different. Signed-off-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-03-26iotests: 163 is not quickEric Blake1-1/+1
Testing on ext4, most 'quick' qcow2 tests took less than 5 seconds, but 163 took more than 20. Let's remove it from the quick set. Signed-off-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2018-03-23qapi: Force UTF8 encoding when parsing qapi filesEric Blake1-3/+3
Commit d4e5ec877 already fixed things to work around Python 3's lame bug of having LC_ALL=C not be 8-bit clean, when parsing the main QMP qapi files; but failed to do likewise in the tests directory. As a result, running 'LC_ALL=C make check' fails on escape-too-big and unicode-str when using python 3 with a nasty stack trace instead of the intended graceful error message that QAPI doesn't yet support 8-bit data (the two tests contain Unicode é, when parsed in UTF-8; they represent something different when parsed in a proper single-byte C locale, but that doesn't matter to the error message printed out, provided that brain-dead Python hasn't first choked on the input instead of being 8-bit clean). Ideally, we'd teach the qapi generator scripts to automatically slurp things in using UTF-8 regardless of locale, and to honor content that is not limited to 7 bit data rather than gracefully erroring out; but until then, since our graceful error depends on python parsing 8-bit data (even if nothing we generate uses 8-bit data), our quick fix is to use the right locale when running these tests. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20180319205040.1113423-1-eblake@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2018-03-23Revert "monitor: enable IO thread for (qmp & !mux) typed"Peter Xu1-9/+1
This reverts commit 3fd2457d18edf5736f713dfe1ada9c87a9badab1. Enabling OOB caused several iotests failures; due to the imminent 2.12 release, the safest action is to disable OOB for now. If other patches fix the issues that iotests exposed, it may be turned back on in time for the release, otherwise it will be 2.13 material; either way, the framework changes not reverted now do not hurt if they remain as part of the 2.12 release. Additionally, revert the tests in the patch 02130314d8 ("qmp: introduce QMPCapability", 2018-03-19), as both parts must be reverted at once to keep 'make check' passing. Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180323140821.28957-2-peterx@redhat.com> Tested-by: Christian Borntraeger <borntraeger@de.ibm.com> [eblake: reorder/squash commits, enhance commit message] Signed-off-by: Eric Blake <eblake@redhat.com>
2018-03-23Revert "tests: qmp-test: verify command batching"Peter Xu1-22/+0
This reverts commit 91ad45061af0fe44ac5dadb5bedaf4d7a08077c8. Enabling OOB caused several iotests failures; due to the imminent 2.12 release, the safest action is to disable OOB, but first we have to revert tests that rely on OOB. Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180323140821.28957-4-peterx@redhat.com> Tested-by: Christian Borntraeger <borntraeger@de.ibm.com> [eblake: reorder commits, enhance commit message] Signed-off-by: Eric Blake <eblake@redhat.com>
2018-03-23Revert "tests: qmp-test: add oob test"Peter Xu1-65/+0
This reverts commit d003f7a8f9cafe50119975844fa01afc2baf41fb. Enabling OOB caused several iotests failures; due to the imminent 2.12 release, the safest action is to disable OOB, but first we have to revert tests that rely on OOB. Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180323140821.28957-3-peterx@redhat.com> Tested-by: Christian Borntraeger <borntraeger@de.ibm.com> [eblake: reorder commits, enhance commit message] Signed-off-by: Eric Blake <eblake@redhat.com>
2018-03-21tests/multiboot: Add .gitignoreKevin Wolf1-0/+3
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Jack Schwartz <jack.schwartz@oracle.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2018-03-21tests/multiboot: Add tests for the a.out kludgeKevin Wolf4-8/+204
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Jack Schwartz <jack.schwartz@oracle.com>
2018-03-21tests/multiboot: Test exit code for every qemu runKevin Wolf1-12/+12
Testing the exit code only once after a whole group of tests has completed is not enough, it catches errors only in the very last qemu invocation. We need to have the check after each qemu run. The logging and diff with the reference output is still done once per group to keep things more managable. This is not a problem because the log file accumulates the output of all runs. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Jack Schwartz <jack.schwartz@oracle.com>
2018-03-20Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell11-64/+56
virtio,vhost,pci,pc: features, cleanups SRAT tables for DIMM devices new virtio net flags for speed/duplex post-copy migration support in vhost cleanups in pci Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Tue 20 Mar 2018 14:40:43 GMT # gpg: using RSA key 281F0DB8D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17 0970 C350 3912 AFBE 8E67 # Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA 8A0D 281F 0DB8 D28D 5469 * remotes/mst/tags/for_upstream: (51 commits) postcopy shared docs libvhost-user: Claim support for postcopy postcopy: Allow shared memory vhost: Huge page align and merge vhost+postcopy: Wire up POSTCOPY_END notify vhost-user: Add VHOST_USER_POSTCOPY_END message libvhost-user: mprotect & madvises for postcopy vhost+postcopy: Call wakeups vhost+postcopy: Add vhost waker postcopy: postcopy_notify_shared_wake postcopy: helper for waking shared vhost+postcopy: Resolve client address postcopy-ram: add a stub for postcopy_request_shared_page vhost+postcopy: Helper to send requests to source for shared pages vhost+postcopy: Stash RAMBlock and offset vhost+postcopy: Send address back to qemu libvhost-user+postcopy: Register new regions with the ufd migration/ram: ramblock_recv_bitmap_test_byte_offset postcopy+vhost-user: Split set_mem_table for postcopy vhost+postcopy: Transmit 'listen' to slave ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org> # Conflicts: # scripts/update-linux-headers.sh
2018-03-20Merge remote-tracking branch ↵Peter Maydell2-0/+105
'remotes/ehabkost/tags/machine-next-pull-request' into staging Machine and x86 queue, 2018-03-19 * cpu_model/cpu_type cleanups * x86: Fix on Intel Processor Trace CPUID checks # gpg: Signature made Mon 19 Mar 2018 20:07:14 GMT # gpg: using RSA key 2807936F984DC5A6 # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/machine-next-pull-request: i386: Disable Intel PT if packets IP payloads have LIP values cpu: drop unnecessary NULL check and cpu_common_class_by_name() cpu: get rid of unused cpu_init() defines Use cpu_create(type) instead of cpu_init(cpu_model) cpu: add CPU_RESOLVING_TYPE macro tests: add machine 'none' with -cpu test nios2: 10m50_devboard: replace cpu_model with cpu_type Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-03-20test/acpi-test-data: add ACPI tables for dimmpxm testHaozhong Zhang10-0/+0
Reviewers can use ACPI tables in this patch to run test_acpi_{piix4,q35}_tcg_dimm_pxm cases. Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2018-03-20tests/bios-tables-test: add test cases for DIMM proximityHaozhong Zhang1-0/+38
QEMU now builds one SRAT memory affinity structure for each PC-DIMM and NVDIMM device presented at boot time with the proximity domain specified in the device option 'node', rather than only one SRAT memory affinity structure covering the entire hotpluggable address space with the proximity domain of the last node. Add test cases on PC and Q35 machines with 4 proximity domains, and one PC-DIMM and one NVDIMM attached to the 2nd and 3rd proximity domains respectively. Check whether the QEMU-built SRAT tables match with the expected ones. The following ACPI tables need to be added for this test: tests/acpi-test-data/pc/APIC.dimmpxm tests/acpi-test-data/pc/DSDT.dimmpxm tests/acpi-test-data/pc/NFIT.dimmpxm tests/acpi-test-data/pc/SRAT.dimmpxm tests/acpi-test-data/pc/SSDT.dimmpxm tests/acpi-test-data/q35/APIC.dimmpxm tests/acpi-test-data/q35/DSDT.dimmpxm tests/acpi-test-data/q35/NFIT.dimmpxm tests/acpi-test-data/q35/SRAT.dimmpxm tests/acpi-test-data/q35/SSDT.dimmpxm New APIC and DSDT are needed because of the multiple processors configuration. New NFIT and SSDT are needed because of NVDIMM. Signed-off-by: Haozhong Zhang <haozhong.zhang@intel.com> Suggested-by: Igor Mammedov <imammedo@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2018-03-19qapi: Pass '-u' when doing non-silent diffEric Blake1-4/+4
Ed-script diffs are awful compared to context diffs. Fix another 'diff -q' while in the area (if the files are different, being noisy makes it easier to diagnose why). While at it, diff .err before .out, because if a test fails, .err is more likely to contain the most important information for fixing the failure. Fixes: 46ec4fce Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20180315125116.804342-1-eblake@redhat.com>
2018-03-19tests: qmp-test: add oob testPeter Xu1-0/+65
Test the new OOB capability. Here we used the new "x-oob-test" command. First, we send a lock=true and oob=false command to hang the main thread. Then send another lock=false and oob=true command (which will be run inside parser this time) to free that hanged command. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180309090006.10018-24-peterx@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [eblake: grammar tweaks] Signed-off-by: Eric Blake <eblake@redhat.com>
2018-03-19tests: qmp-test: verify command batchingPeter Xu1-0/+22
OOB introduced DROP event for flow control. This should not affect old QMP clients. Add a command batching check to make sure of it. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180309090006.10018-23-peterx@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com>
2018-03-19qapi: introduce new cmd option "allow-oob"Peter Xu1-1/+1
Here "oob" stands for "Out-Of-Band". When "allow-oob" is set, it means the command allows out-of-band execution. The "oob" idea is proposed by Markus Armbruster in following thread: https://lists.gnu.org/archive/html/qemu-devel/2017-09/msg02057.html This new "allow-oob" boolean will be exposed by "query-qmp-schema" as well for command entries, so that QMP clients can know which commands can be used in out-of-band calls. For example the command "migrate" originally looks like: {"name": "migrate", "ret-type": "17", "meta-type": "command", "arg-type": "86"} And it'll be changed into: {"name": "migrate", "ret-type": "17", "allow-oob": false, "meta-type": "command", "arg-type": "86"} This patch only provides the QMP interface level changes. It does not contain the real out-of-band execution implementation yet. Suggested-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180309090006.10018-18-peterx@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [eblake: rebase on introspection done by qlit] Signed-off-by: Eric Blake <eblake@redhat.com>
2018-03-19qmp: introduce QMPCapabilityPeter Xu1-1/+9
There were no QMP capabilities defined. Define the first capability, "oob", to allow out-of-band messages. After this patch, we will allow QMP clients to enable QMP capabilities when sending the first "qmp_capabilities" command. Originally we are starting QMP session with no arguments like: { "execute": "qmp_capabilities" } Now we can enable some QMP capabilities using (take OOB as example, which is the only capability that we support): { "execute": "qmp_capabilities", "arguments": { "enable": [ "oob" ] } } When the "arguments" key is not provided, no capability is enabled. For capability "oob", the monitor needs to be run on a dedicated IO thread, otherwise the command will fail. For example, trying to enable OOB on a MUXed typed QMP monitor will fail. One thing to mention is that QMP capabilities are per-monitor, and also when the connection is closed due to some reason, the capabilities will be reset. Also, touch up qmp-test.c to test the new bits. Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20180309090006.10018-11-peterx@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [eblake: touch up commit message] Signed-off-by: Eric Blake <eblake@redhat.com>
2018-03-19block: Handle null backing linkMax Reitz2-0/+28
Instead of converting all "backing": null instances into "backing": "", handle a null value directly in bdrv_open_inherit(). This enables explicitly null backing links for json:{} filenames. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Message-Id: <20180224154033.29559-7-mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [eblake: rebase to qobject_to() parameter order and qapi headers split] Signed-off-by: Eric Blake <eblake@redhat.com>
2018-03-19qapi: Replace qobject_to_X(o) by qobject_to(X, o)Max Reitz19-125/+128
This patch was generated using the following Coccinelle script: @@ expression Obj; @@ ( - qobject_to_qnum(Obj) + qobject_to(QNum, Obj) | - qobject_to_qstring(Obj) + qobject_to(QString, Obj) | - qobject_to_qdict(Obj) + qobject_to(QDict, Obj) | - qobject_to_qlist(Obj) + qobject_to(QList, Obj) | - qobject_to_qbool(Obj) + qobject_to(QBool, Obj) ) and a bit of manual fix-up for overly long lines and three places in tests/check-qjson.c that Coccinelle did not find. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Message-Id: <20180224154033.29559-4-mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [eblake: swap order from qobject_to(o, X), rebase to master, also a fix to latent false-positive compiler complaint about hw/i386/acpi-build.c] Signed-off-by: Eric Blake <eblake@redhat.com>
2018-03-19tests: add machine 'none' with -cpu testIgor Mammedov2-0/+105
Check that "$QEMU -M none -cpu FOO" starts QEMU without error Signed-off-by: Igor Mammedov <imammedo@redhat.com> Message-Id: <1518000027-274608-3-git-send-email-imammedo@redhat.com> [ehabkost: include qmp/qdict.h instead of qmp/types.h] [ehabkost: add riscv targets to machine-none-test] Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>