aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2019-09-05nbd: Improve per-export flag handling in serverEric Blake1-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]
2019-09-05nbd: Tolerate more errors to structured reply requestEric Blake1-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]
2019-09-05nbd: Advertise multi-conn for shared read-only connectionsEric Blake1-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>
2019-09-04Merge remote-tracking branch 'remotes/juanquintela/tags/fail-pull-request' ↵Peter Maydell4-11/+11
into staging Fix multifd with big number of channels # gpg: Signature made Wed 04 Sep 2019 07:28:31 BST # gpg: using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723 # gpg: Good signature from "Juan Quintela <quintela@redhat.com>" [full] # gpg: aka "Juan Quintela <quintela@trasno.org>" [full] # Primary key fingerprint: 1899 FF8E DEBF 58CC EE03 4B82 F487 EF18 5872 D723 * remotes/juanquintela/tags/fail-pull-request: multifd: Use number of channels as listen backlog socket: Add num connections to qio_net_listener_open_sync() socket: Add num connections to qio_channel_socket_async() socket: Add num connections to qio_channel_socket_sync() socket: Add backlog parameter to socket_listen Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-09-04Merge remote-tracking branch ↵Peter Maydell1-0/+35
'remotes/ehabkost/tags/machine-next-pull-request' into staging Machine + x86 queue, 2019-09-03 Bug fixes: * Fix die-id validation regression (Eduardo Habkost) * vmmouse: Properly reset state (Jan Kiszka) * hostmem-file: fix pmem file size check (Stefan Hajnoczi) * Keep query-hotpluggable-cpus output compatible with older QEMU if '-smp dies' is not set (Igor Mammedov) * migration: Do not re-read the clock on pre_save in case of paused guest (Maxiwell S. Garcia) Cleanups: * NUMA code cleanups (Tao Xu) * Remove stale externs from includes (Alex Bennée) Features: * qapi: report the default CPU type for each machine (Daniel P. Berrangé) # gpg: Signature made Tue 03 Sep 2019 21:57:37 BST # gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6 # gpg: issuer "ehabkost@redhat.com" # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full] # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/machine-next-pull-request: migration: Do not re-read the clock on pre_save in case of paused guest x86: do not advertise die-id in query-hotpluggbale-cpus if '-smp dies' is not set i386/vmmouse: Properly reset state hostmem-file: fix pmem file size check qapi: report the default CPU type for each machine pc: Don't make die-id mandatory unless necessary pc: Improve error message when die-id is omitted pc: Fix error message on die-id validation numa: move numa global variable numa_info into MachineState numa: move numa global variable have_numa_distance into MachineState numa: move numa global variable nb_numa_nodes into MachineState hw/arm: simplify arm_load_dtb includes: remove stale [smp|max]_cpus externs Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-09-04Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2019-09-03' ↵Peter Maydell47-60/+203
into staging Block patches: - qemu-io now accepts a file to read a write pattern from - Ensure that raw files have their first block allocated so we can probe the O_DIRECT alignment if necessary - Various fixes # gpg: Signature made Tue 03 Sep 2019 13:58:57 BST # gpg: using RSA key 91BEB60A30DB3E8857D11829F407DB0061D5CF40 # gpg: issuer "mreitz@redhat.com" # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" [full] # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1 1829 F407 DB00 61D5 CF40 * remotes/maxreitz/tags/pull-block-2019-09-03: iotests: Unify cache mode quoting tests/check-block: Skip iotests when sanitizers are enabled iotests: Check for enabled drivers before testing them iotests: Add -display none to the qemu options file-posix: fix request_alignment typo iotests: Disable 126 for flat vmdk subformats iotests: Disable 110 for vmdk.twoGbMaxExtentSparse iotests: Disable broken streamOptimized tests vmdk: Reject invalid compressed writes iotests: Keep testing broken relative extent paths vmdk: Use bdrv_dirname() for relative extent paths iotests: Fix _filter_img_create() iotests: Test allocate_first_block() with O_DIRECT block: posix: Always allocate the first block block: fix permission update in bdrv_replace_node qemu-io: add pattern file for write command Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-09-04Merge remote-tracking branch ↵Peter Maydell1-13/+14
'remotes/stsquad/tags/pull-gdbstub-gitdm-testing-020919-1' into staging Various maintainer updates - fixes for gdbstub regressions - bunch of gitdm/mailmap updates - module fixes for Travis - docker fixes for shippable # gpg: Signature made Mon 02 Sep 2019 11:19:04 BST # gpg: using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44 # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full] # Primary key fingerprint: 6685 AE99 E751 67BC AFC8 DF35 FBD0 DB09 5A9E 2A44 * remotes/stsquad/tags/pull-gdbstub-gitdm-testing-020919-1: tests/docker: upgrade docker.py to python3 tests: fix modules-test with no default machine build-sys: build ui-spice-app as a module contrib/gitdm: Add RT-RK to the domain-map .mailmap/aliases: add some further commentary mailmap: Add many entries to improve 'git shortlog' statistics mailmap: Update philmd email address mailmap: Reorder by sections contrib/gitdm: Add armbru@pond.sub.org to group-map-redhat contrib/gitdm: filetype interface is not in order, fix gdbstub: Fix handler for 'F' packet gdbstub: Fix handling of '!' packet with new infra Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-09-03socket: Add num connections to qio_channel_socket_async()Juan Quintela1-1/+1
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2019-09-03socket: Add num connections to qio_channel_socket_sync()Juan Quintela3-4/+4
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
2019-09-03socket: Add backlog parameter to socket_listenJuan Quintela1-6/+6
Current parameter was always one. We continue with that value for now in all callers. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> --- Moved trace to socket_listen
2019-09-03pc: Don't make die-id mandatory unless necessaryEduardo Habkost1-0/+35
We have this issue reported when using libvirt to hotplug CPUs: https://bugzilla.redhat.com/show_bug.cgi?id=1741451 Basically, libvirt is not copying die-id from query-hotpluggable-cpus, but die-id is now mandatory. We could blame libvirt and say it is not following the documented interface, because we have this buried in the QAPI schema documentation: > Note: currently there are 5 properties that could be present > but management should be prepared to pass through other > properties with device_add command to allow for future > interface extension. This also requires the filed names to be kept in > sync with the properties passed to -device/device_add. But I don't think this would be reasonable from us. We can just make QEMU more flexible and let die-id to be omitted when there's no ambiguity. This will allow us to keep compatibility with existing libvirt versions. Test case included to ensure we don't break this again. Fixes: commit 176d2cda0dee ("i386/cpu: Consolidate die-id validity in smp context") Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20190816170750.23910-1-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-09-03Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-4.2-20190829' ↵Peter Maydell2-3/+16
into staging ppc patch queue 2018-08-29 Another pull request for ppc-for-4.2. Includes * Several powernv patches which were pulled last minute from the last PULL, now that some problems with them have been sorted out * A fix for -no-reboot which has been broken since the pseries-rhel4.1.0 machine type * Add some host threads information which AIX guests will need to properly scale the PURR and SPURR * Change behaviour to match x86 when unplugging function 0 of a multifunction PCI device * A number of TCG fixes in FPU emulation And a handful of other assorted fixes and cleanups. # gpg: Signature made Thu 29 Aug 2019 06:36:23 BST # gpg: using RSA key 75F46586AE61A66CC44E87DC6C38CACA20D9B392 # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>" [full] # gpg: aka "David Gibson (Red Hat) <dgibson@redhat.com>" [full] # gpg: aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>" [full] # gpg: aka "David Gibson (kernel.org) <dwg@kernel.org>" [unknown] # Primary key fingerprint: 75F4 6586 AE61 A66C C44E 87DC 6C38 CACA 20D9 B392 * remotes/dgibson/tags/ppc-for-4.2-20190829: spapr: Set compat mode in spapr_core_plug() spapr/pci: Convert types to QEMU coding style spapr_pci: Advertise BAR reallocation capability spapr: Use SHUTDOWN_CAUSE_SUBSYSTEM_RESET for CAS reboots powerpc/spapr: Add host threads parameter to ibm,get_system_parameter pseries: Update SLOF firmware image target/ppc: Refactor emulation of vmrgew and vmrgow instructions target/ppc: Fix do_float_check_status vs inexact target/ppc: Set float_tininess_before_rounding at cpu reset pseries: Fix compat_pvr on reset spapr_pci: remove all child functions in function zero unplug ppc: Fix xscvdpspn for SNAN ppc: Fix xsmaddmdp and friends tests/boot-serial-test: add support for all the PowerNV machines ppc/pnv: Introduce PowerNV machines with fixed CPU models ppc/pnv: Generate phandle for the "interrupt-parent" property ppc/pnv: add more dummy XSCOM addresses for the P9 CAPP ppc/pnv: update skiboot to v6.4 ppc/pnv: Set default ram size to 1.75GB Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-09-03Merge remote-tracking branch 'remotes/cleber/tags/python-next-pull-request' ↵Peter Maydell5-6/+25
into staging Python (acceptance tests) queue, 2019-08-28 # gpg: Signature made Thu 29 Aug 2019 02:11:22 BST # gpg: using RSA key 7ABB96EB8B46B94D5E0FE9BB657E8D33A5F209F3 # gpg: Good signature from "Cleber Rosa <crosa@redhat.com>" [marginal] # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 7ABB 96EB 8B46 B94D 5E0F E9BB 657E 8D33 A5F2 09F3 * remotes/cleber/tags/python-next-pull-request: VNC Acceptance test: simplify test names Boot Linux Console Test: add a test for ppc64 + pseries Acceptance tests: drop left over usage of ":avocado: enable" tests/requirements.txt: pin paramiko version requirement tests.acceptance.avocado_qemu: Add support for powerpc Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-09-03Merge remote-tracking branch ↵Peter Maydell2-6/+6
'remotes/ehabkost/tags/python-next-pull-request' into staging Python queue, 2019-08-28 Bug fix: * configure: more resilient Python version capture (Cleber Rosa) Cleanup: * BootLinuxSshTest: Only use 'test' for unittest.TestCase method names (Philippe Mathieu-Daudé) # gpg: Signature made Wed 28 Aug 2019 20:22:35 BST # gpg: using RSA key 5A322FD5ABC4D3DBACCFD1AA2807936F984DC5A6 # gpg: issuer "ehabkost@redhat.com" # gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>" [full] # Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6 * remotes/ehabkost/tags/python-next-pull-request: configure: more resilient Python version capture BootLinuxSshTest: Only use 'test' for unittest.TestCase method names Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-09-03iotests: Unify cache mode quotingNir Soffer4-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>
2019-09-03tests/check-block: Skip iotests when sanitizers are enabledThomas Huth1-0/+5
The sanitizers (especially the address sanitizer from Clang) are sometimes printing out warnings or false positives - this spoils the output of the iotests, causing some of the tests to fail. Thus let's skip the automatic iotests during "make check" when the user configured QEMU with --enable-sanitizers. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-id: 20190823084203.29734-1-thuth@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2019-09-03iotests: Check for enabled drivers before testing themThomas Huth8-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>
2019-09-03iotests: Add -display none to the qemu optionsMax Reitz1-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>
2019-09-03iotests: Disable 126 for flat vmdk subformatsMax Reitz1-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>
2019-09-03iotests: Disable 110 for vmdk.twoGbMaxExtentSparseMax Reitz1-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>
2019-09-03iotests: Disable broken streamOptimized testsMax Reitz21-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>
2019-09-03iotests: Keep testing broken relative extent pathsMax Reitz2-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>
2019-09-03vmdk: Use bdrv_dirname() for relative extent pathsMax Reitz2-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>
2019-09-03iotests: Fix _filter_img_create()Max Reitz2-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>
2019-09-03iotests: Test allocate_first_block() with O_DIRECTNir Soffer2-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>
2019-09-03block: posix: Always allocate the first blockNir Soffer8-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>
2019-09-02tests/docker: upgrade docker.py to python3Alex Bennée1-13/+14
The recent podman changes (9459f754134bb) imported enum which is part of the python3 standard library but only available as an external library for python2. This causes problems on the fairly restricted environment such as shippable. Lets bite the bullet and make the script a fully python3 one. To that end: - drop the from __future__ import (we are there now ;-) - avoid the StringIO import hack - be consistent with the mode we read/write dockerfiles - s/iteritems/items/ - ensure check_output returns strings for processing Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
2019-09-02tests: fix modules-test with no default machineMarc-André Lureau1-1/+3
Fixes: eb062cfa733 ("tests: add module loading test") Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20190827140241.20818-2-marcandre.lureau@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2019-09-02build-sys: build ui-spice-app as a moduleMarc-André Lureau1-0/+3
This reverts commit 45db1ac157 ("modules-test: ui-spice-app is not built as module") and fixes commit d8aec9d9f1 ("display: add -display spice-app launching a Spice client"). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20190827140241.20818-1-marcandre.lureau@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2019-08-28VNC Acceptance test: simplify test namesCleber Rosa1-2/+2
The test name is composed of the class name and method name, so it looks like there's some redundancy here that we can eliminate. Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190607152223.9467-7-crosa@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-08-28Boot Linux Console Test: add a test for ppc64 + pseriesCleber Rosa1-0/+19
Just like the previous tests, boots a Linux kernel on a ppc64 target using the pseries machine. Signed-off-by: Cleber Rosa <crosa@redhat.com> CC: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Message-Id: <20190607152223.9467-5-crosa@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-08-28Acceptance tests: drop left over usage of ":avocado: enable"Cleber Rosa1-3/+0
Commit 9531d26c10 removed all of ":avocado: enable" tags, but then a new entry was added with the introduction of migration.py. Let's remove it for consistency. Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190607152223.9467-4-crosa@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-08-28tests/requirements.txt: pin paramiko version requirementCleber Rosa1-1/+1
It's a good practice (I'd really say a must) to pin as much as possible of the software versions used during test, so let's apply that to paramiko. According to https://pypi.org/project/paramiko/, 2.4.2 is the latest released version. It's also easily obtainable on systems such as Fedora 30. Signed-off-by: Cleber Rosa <crosa@redhat.com> Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190607152223.9467-3-crosa@redhat.com> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-08-28tests.acceptance.avocado_qemu: Add support for powerpcSatheesh Rajendran1-0/+3
Current acceptance test will not run properly in powerpc environment due qemu target is different from arch, this usually matches, except with bi-endian architectures like ppc64. uname would return `ppc64` or `ppc64le` based `big` or `little` endian but qemu `target` is always `ppc64`. Let's handle it. Reviewed-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com> Message-Id: <20190819082820.14817-1-sathnaga@linux.vnet.ibm.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Cleber Rosa <crosa@redhat.com>
2019-08-29tests/boot-serial-test: add support for all the PowerNV machinesCédric Le Goater1-1/+2
Use the machine names specifiying the CPU type, POWER8 and POWER9. Signed-off-by: Cédric Le Goater <clg@kaod.org> Message-Id: <20190731141233.1340-3-clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-08-29ppc/pnv: Introduce PowerNV machines with fixed CPU modelsCédric Le Goater1-2/+14
Make the current "powernv" machine an abstract type and derive from it new machines with specific CPU models: power8 and power9. The "powernv" machine is now an alias on the "powernv9" machine. Signed-off-by: Cédric Le Goater <clg@kaod.org> Message-Id: <20190731141233.1340-2-clg@kaod.org> [dwg: Adjust pnv-xscom-test to cope with this change] Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2019-08-27configure: more resilient Python version captureCleber Rosa1-1/+1
The current approach to capture the Python version is fragile, as it was demonstrated by a very specific build of Python 3 on Fedora 29 that, under non-interactive shells would print multiline version information. The (badly) stripped version output would be sent to config-host.mak, producing bad syntax and rendering the makefiles unusable. Now, the Python versions is printed by configure, but only a simple (and better controlled variable) indicating whether the build system is using Python 2 is kept on config-host.mak. Signed-off-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20190826155832.17427-1-crosa@redhat.com> Reviewed-by: Tony Nguyen <tony.nguyen@bt.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-08-27BootLinuxSshTest: Only use 'test' for unittest.TestCase method namesPhilippe Mathieu-Daudé1-5/+5
In commit f6e501a28ef9, Eduardo started to use "check_" as a prefix for methods of similar purpose. Follow this prior art, since it might become the conventions when writting Avocado tests. Suggested-by: Cleber Rosa <crosa@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20190607174953.22342-1-philmd@redhat.com> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2019-08-27tests: fix modules-test with no default machineMarc-André Lureau1-1/+3
Fixes: eb062cfa733 ("tests: add module loading test") Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-id: 20190827140241.20818-2-marcandre.lureau@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-08-27build-sys: build ui-spice-app as a moduleMarc-André Lureau1-0/+3
This reverts commit 45db1ac157 ("modules-test: ui-spice-app is not built as module") and fixes commit d8aec9d9f1 ("display: add -display spice-app launching a Spice client"). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-id: 20190827140241.20818-1-marcandre.lureau@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-08-23modules-test: ui-spice-app is not built as modulePaolo Bonzini1-3/+0
$(call land, $(CONFIG_SPICE), $(CONFIG_GIO)) will never return "m" so ui-spice-app is always linked into QEMU. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Miroslav Rezanina <mrezanin@redhat.com> Message-id: 1566495734-23297-2-git-send-email-pbonzini@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-08-23modules-test: fix const castPaolo Bonzini1-1/+1
Add a missing cast; this fixes a build failure with --enable-modules. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Miroslav Rezanina <mrezanin@redhat.com> Message-id: 1566495734-23297-1-git-send-email-pbonzini@redhat.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-08-22test: skip tests if socket_check_protocol_support() failedMarc-André Lureau3-3/+9
Skip the tests if socket_check_protocol_support() failed, but do run g_test_run() to keep TAP harness happy. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-08-22test-char: skip tcp tests if ipv4 check failedMarc-André Lureau2-5/+14
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-08-22tests: specify the address family when checking bindMarc-André Lureau2-15/+13
getaddrinfo() may succeed with PF_UNSPEC, but fail when more specific. (this allows to skip some tests that would fail under podman) Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-08-22tests/docker: add podman supportMarc-André Lureau1-2/+6
Allow to specify the container engine to run with ENGINE variable. By default, ENGINE=auto and will select either podman or docker. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-08-22docker.py: add podman supportMarc-André Lureau1-5/+43
Add a --engine option to select either docker, podman or auto. Among other advantages, podman allows to run rootless & daemonless containers, fortunately sharing compatible CLI with docker. With current podman, we have to use a uidmap trick in order to be able to rw-share the ccache directory with the container user. With a user 1000, the default mapping is: 1000 (host) -> 0 (container). So write access to /var/tmp/ccache ends will end with permission denied error. With "--uidmap 1000:0:1 --uidmap 0:1:1000", the mapping is: 1000 (host) -> 0 (container, 1st namespace) -> 1000 (container, 2nd namespace). (the rest is mumbo jumbo to avoid holes in the range of UIDs) A future podman version may have an option such as --userns-keep-uid. Thanks to Debarshi Ray <rishi@redhat.com> for the help! Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-08-22docker.py: add --run-as-current-userMarc-André Lureau2-1/+6
(podman will need further tweaks) Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2019-08-22Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into stagingPeter Maydell4-0/+80
* Longstanding chardev race condition fix (Berto) * Cleanups and tests from the Meson POC (Marc-André, myself) * Coalesced range cleanup (Peter) # gpg: Signature made Wed 21 Aug 2019 18:27:43 BST # gpg: using RSA key BFFBD25F78C7AE83 # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full] # gpg: aka "Paolo Bonzini <pbonzini@redhat.com>" [full] # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4 E2F7 7E15 100C CD36 69B1 # Subkey fingerprint: F133 3857 4B66 2389 866C 7682 BFFB D25F 78C7 AE83 * remotes/bonzini/tags/for-upstream: char-socket: Lock tcp_chr_disconnect() and socket_reconnect_timeout() main-loop: Fix GSource leak in qio_task_thread_worker() memory: Fix up memory_region_{add|del}_coalescing memory: Remove has_coalesced_range counter memory: Split zones when do coalesced_io_del() memory: Refactor memory_region_clear_coalescing minikconf: don't print CONFIG_FOO=n lines configure: remove AUTOCONF_HOST tests: add module loading test module: return success on module load module: use g_hash_table_add() configure: define CONFIG_TOOLS here qemu-ga: clean up TOOLS variable Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2019-08-21Merge remote-tracking branch ↵Peter Maydell2-5/+5
'remotes/vivier2/tags/trivial-branch-pull-request' into staging Various trivial fixes # gpg: Signature made Wed 21 Aug 2019 12:19:11 BST # gpg: using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C # gpg: issuer "laurent@vivier.eu" # gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full] # gpg: aka "Laurent Vivier <laurent@vivier.eu>" [full] # gpg: aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full] # Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F 5173 F30C 38BD 3F2F BE3C * remotes/vivier2/tags/trivial-branch-pull-request: hw/display: Compile various display devices as common object hw/display/sm501: Remove unused include spapr_events: Rewrite a fall through comment vl: Rewrite a fall through comment target/ppc: Rewrite a fall through comment hw/ipmi: Rewrite a fall through comment hw/dma/omap_dma: Move switch 'fall through' comment to correct place json: Move switch 'fall through' comment to correct place hw/net/e1000: Fix erroneous comment .gitignore: ignore some vhost-user* related files configure: fix sdl detection using sdl2-config configure: remove obsoleted $sparc_cpu variable misc: fix naming scheme of compatiblity arrays test: Use g_strndup instead of plain strndup Signed-off-by: Peter Maydell <peter.maydell@linaro.org>