aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2017-11-03Merge remote-tracking branch ↵Peter Maydell
'remotes/stsquad/tags/pull-ci-updates-for-softfreeze-021117-2' into staging One fix for win32/64 cross compiles. # gpg: Signature made Thu 02 Nov 2017 11:55:46 GMT # gpg: using RSA key 0xFBD0DB095A9E2A44 # gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" # Primary key fingerprint: 6685 AE99 E751 67BC AFC8 DF35 FBD0 DB09 5A9E 2A44 * remotes/stsquad/tags/pull-ci-updates-for-softfreeze-021117-2: docker: add python stdlib dependency (required by keycodemapdb) Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-11-02docker: add python stdlib dependency (required by keycodemapdb)Philippe Mathieu-Daudé
Since 927128222b0a QEMU depends of keycodemapdb, which uses the python 'csv' module from stdlib to parse keymaps.csv. Without this package the build fails: GEN ui/input-keymap-linux-to-qcode.c Traceback (most recent call last): File "ui/keycodemapdb/tools/keymap-gen", line 15, in <module> import csv ImportError: No module named csv GEN ui/input-keymap-qcode-to-qnum.c Traceback (most recent call last): File "ui/keycodemapdb/tools/keymap-gen", line 15, in <module> import csv ImportError: No module named csv [...] CC ui/input-keymap.o ui/input-keymap.c:8:44: fatal error: ui/input-keymap-linux-to-qcode.c: No such file or directory make: *** [ui/input-keymap.o] Error 1 Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2017-10-30nbd: Minimal structured read for clientVladimir Sementsov-Ogievskiy
Minimal implementation: for structured error only error_report error message. Note that test 83 is now more verbose, because the implementation prints more warnings about unexpected communication errors; perhaps future patches should tone things down by using trace messages instead of traces, but the common case of successful communication is no noisier than before. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <20171027104037.8319-13-eblake@redhat.com>
2017-10-29tests: check that migration parameters are really assignedJuan Quintela
Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2017-10-29tests: Don't abuse global_qtestJuan Quintela
As we have two guests running, just pass always who we want to send a message to. Once there, refactor return_or_event() into wait_command. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2017-10-29tests: Factorize out migrate_test_start/endJuan Quintela
We fix global_test users left and right Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2017-10-29tests: Refactor setting of parameters/capabilitiesJuan Quintela
So we can use them in future tests Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2017-10-29tests: rename postcopy-test to migration-testJuan Quintela
Instead of repeating the code, we are going to bo more tests on this file Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2017-10-26iotests: Add cluster_size=64k to 125Max Reitz
Apparently it would be a good idea to test that, too. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20171009215533.12530-4-mreitz@redhat.com Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-10-26iotests: Filter actual image size in 184 and 191Max Reitz
Whenever the actual image size is not part of the test, it should be filtered as it depends on the host filesystem. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20171009163456.485-3-mreitz@redhat.com Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-10-26iotests: Pull _filter_actual_image_size from 67/87Max Reitz
Tests 067 and 087 filter the actual image size because it depends on the host filesystem (and is not part of the respective test). Since this is generally true, we should have a common filter function for this, so let's pull out the sed line from both tests into such a function. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20171009163456.485-2-mreitz@redhat.com Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Jeff Cody <jcody@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-10-26iotests: Add test for dataplane mirroringMax Reitz
Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20170929170843.3711-1-mreitz@redhat.com Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-10-26qemu-io: Relax 'alloc' now that block-status doesn't assertEric Blake
Previously, the alloc command required that input parameters be sector-aligned and clamped to 32 bits, because the underlying bdrv_is_allocated used a 32-bit parameter and asserted aligned inputs. But now that we have fixed block status to report a 64-bit bytes value, and to properly round requests on behalf of guests, we can pass any values, and can use qemu-io to add coverage that our rounding is correct regardless of the guest alignment constraints. Update iotest 177 to intentionally probe block status at unaligned boundaries as well as with a bytes value that does not map to 32-bit sectors, which also required tweaking the image prep to leave an unallocated portion to the image under test. Signed-off-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-10-26qemu-img: Drop redundant error message in compareEric Blake
If a read error is encountered during 'qemu-img compare', we were printing the "Error while reading offset ..." message twice; this was because our helper function was awkward, printing output on some but not all paths. Fix it to consistently report errors on all paths, so that the callers do not risk a redundant message, and update the testsuite for the improved output. Further simplify the code by hoisting the conversion from an error message to an exit code into the helper function, rather than repeating that logic at all callers (yes, the helper function is now less generic, but it's a net win in lines of code). Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-10-26qemu-iotests: Test backing_fmt with backing node referenceKevin Wolf
This changes test case 191 to include a backing image that has backing_fmt set in the image file, but is referenced by node name in the qemu command line. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2017-10-24tcg: define CF_PARALLEL and use it for TB hashing along with CF_COUNT_MASKEmilio G. Cota
This will enable us to decouple code translation from the value of parallel_cpus at any given time. It will also help us minimize TB flushes when generating code via EXCP_ATOMIC. Note that the declaration of parallel_cpus is brought to exec-all.h to be able to define there the "curr_cflags" inline. Signed-off-by: Emilio G. Cota <cota@braap.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2017-10-20Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20171020' into stagingPeter Maydell
The last big chunk of s390x changes: - (experimental) smp support under tcg - provide the virtio-input devices for virtio-ccw - improve error handling in the css code - enable some simple virtio tests for s390x - low-address protection in tcg - some more cleanups and fixes # gpg: Signature made Fri 20 Oct 2017 12:49:22 BST # gpg: using RSA key 0xDECF6B93C6F02FAF # gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" # gpg: aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" # gpg: aka "Cornelia Huck <cornelia.huck@de.ibm.com>" # gpg: aka "Cornelia Huck <cohuck@kernel.org>" # gpg: aka "Cornelia Huck <cohuck@redhat.com>" # Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0 18CE DECF 6B93 C6F0 2FAF * remotes/cohuck/tags/s390x-20171020: (46 commits) s390x/tcg: low-address protection support accel/tcg: allow to invalidate a write TLB entry immediately tests: Enable the very simple virtio tests on s390x, too libqtest: Add qtest_[v]startf() s390x: refactor error handling for MSCH handler s390x: refactor error handling for HSCH handler s390x: refactor error handling for CSCH handler s390x: refactor error handling for XSCH handler s390x: improve error handling for SSCH and RSCH s390x/css: IO instr handler ending control s390x: move s390x_new_cpu() into board code s390x: fix cpu object referrence leak in s390x_new_cpu() s390x/event-facility: variable-length event masks s390x/MAINTAINERS: add mailing list virtio-ccw: Add the virtio-input devices for CCW bus target/s390x: special handling when starting a CPU with WAIT PSW s390x/tcg: refactor stfl(e) to use s390_get_feat_block() s390x/tcg: unlock NMI s390x/cpumodel: allow to enable SENSE RUNNING STATUS for qemu s390x/tcg: switch to new SIGP handling code ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-10-20tests: Enable the very simple virtio tests on s390x, tooThomas Huth
These tests can easily be used on s390x, too. We just have to make sure to use the virtio-xxx-ccw devices instead of virtio-xxx-pci. Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1508336428-20511-3-git-send-email-thuth@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2017-10-20libqtest: Add qtest_[v]startf()Eric Blake
We have several callers that were formatting the argument strings themselves; consolidate this effort by adding new convenience functions directly in libqtest, and update some call-sites that can benefit from it. Note that the new functions qtest_startf() and qtest_vstartf() behave more like qtest_init() (the caller must assign global_qtest after the fact, rather than getting it implicitly set). This helps us prepare for future patches that get rid of the global variable, by explicitly highlighting which tests still depend on it now. Signed-off-by: Eric Blake <eblake@redhat.com> [thuth: Dropped the hunks that do not apply cleanly to qemu master yet and added the missing g_free(args) in qtest_vstartf()] Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1508336428-20511-2-git-send-email-thuth@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2017-10-20docker: Fix PATH for ccacheFam Zheng
Before bcd7f06f57fb6f780a3e2f7a46c22b6f6c8238aa we source /etc/profile so the PATH included the right paths to ccache binaries. Now we need to update $PATH explicitly from run script. Keep the old /usr/lib around just so that in the future, ccache from 32 bit images will just work. Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <20171018073841.30062-1-famz@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com>
2017-10-20docker: fix out-of-tree 'make docker-test-build@debian-powerpc-cross'Greg Kurz
Without this patch, it fails with: IOError: [Errno 2] No such file or directory: 'tests/docker/dockerfiles/debian-apt-fake.sh' Signed-off-by: Greg Kurz <groug@kaod.org> Message-Id: <150841324224.31292.4012464539983692364.stgit@bahia.lan> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Fam Zheng <famz@redhat.com>
2017-10-20docker: allow running from srcdir != builddir buildPaolo Bonzini
The new script uses "git submodule", which is picky about being invoked from the top of the git checkout. Invoke the script from $(SRC_PATH) to avoid git's wrath. Fixes: b7f404201e45e99da23b9764dec27ce5f965cdcd Cc: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Message-Id: <1508331989-142364-1-git-send-email-pbonzini@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com>
2017-10-20docker: cleanup temp directory after testPeter Xu
There are temp directories named "docker-src.*" after doing docker tests. I don't see much point in keeping that (it only contains the qemu.tar which is exactly current tree, and the copied "run" file). Let's remove it after test finished. CC: "Alex Bennée" <alex.bennee@linaro.org> CC: Fam Zheng <famz@redhat.com> CC: "Philippe Mathieu-Daudé" <f4bug@amsat.org> Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20171017071247.32355-1-peterx@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com>
2017-10-20docker: Don't allocate tty unless DEBUG=1Fam Zheng
The existence of tty in the container seems to urge gcc into colorizing the errors, but the escape chars will clutter the report once turned into email replies on patchew. Move -t to debug mode. Reported-by: Eric Blake <eblake@redhat.com> Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <20171013011954.9975-1-famz@redhat.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Fam Zheng <famz@redhat.com>
2017-10-17Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into ↵Peter Maydell
staging trivial patches for 2017-10-16 # gpg: Signature made Mon 16 Oct 2017 21:32:05 BST # gpg: using RSA key 0x701B4F6B1A693E59 # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>" # gpg: aka "Michael Tokarev <mjt@corpit.ru>" # gpg: aka "Michael Tokarev <mjt@debian.org>" # Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D 4324 457C E0A0 8044 65C5 # Subkey fingerprint: 7B73 BAD6 8BE7 A2C2 8931 4B22 701B 4F6B 1A69 3E59 * remotes/mjt/tags/trivial-patches-fetch: Add myself as maintainer for TPM code filter-mirror: segfault when specifying non existent device MAINTAINERS: Track default-configs/pci.mak MAINTAINERS: Fix Sun4v file MAINTAINERS: Clean up SCSI device section include/hw/or-irq.h: Drop unused in_irqs field io: Add missing GCC_FMT_ATTR (fix -Werror=suggest-attribute=format) os-posix: Drop misleading comment linux-user: Add some random ioctls futex: add missing header guards ui/gtk: Fix deprecation of vte_terminal_copy_clipboard gitignore: ignore check-qlit test linux-user: remove duplicate break in syscall qemu-doc.texi: remove trailing whitespace Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-10-16gitignore: ignore check-qlit testCarlo Marcelo Arenas Belón
test introduced in 382176b4d78e070d119af8e0dcd00884c11bbec2 Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2017-10-16Merge remote-tracking branch 'remotes/huth/tags/pull-request-2017-10-16' ↵Peter Maydell
into staging Some m68k, qtest and config improvements # gpg: Signature made Mon 16 Oct 2017 13:38:03 BST # gpg: using RSA key 0x2ED9D774FE702DB5 # gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" # gpg: aka "Thomas Huth <thuth@redhat.com>" # gpg: aka "Thomas Huth <huth@tuxfamily.org>" # gpg: aka "Thomas Huth <th.huth@posteo.de>" # Primary key fingerprint: 27B8 8847 EEE0 2501 18F3 EAB9 2ED9 D774 FE70 2DB5 * remotes/huth/tags/pull-request-2017-10-16: default-configs: Enable CONFIG_VMXNET3_PCI only on x86 tests/prom-env: Bump the timeout, and test pseries only in slow mode tests: use g_new() family of functions M68K: use g_new() family of functions hw/m68k: Replace fprintf(stderr, "*\n" with error_report() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-10-16Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell
pc, pci, virtio: fixes, features A bunch of fixes all over the place. A new vmcore device - the user interface around it is still somewhat controversial, but I feel most of the code is fine, suggestions can be addressed by adding patches on top. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Sun 15 Oct 2017 04:02:23 BST # gpg: using RSA key 0x281F0DB8D28D5469 # 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: (26 commits) tests/pxe: Test more NICs when running in SPEED=slow mode pc: remove useless hot_add_cpu initialisation isapc: Remove unnecessary migration compatibility code virtio-pci: Replace modern_as with direct access to modern_bar virtio: fix descriptor counting in virtqueue_pop hw/gen_pcie_root_port: make IO RO 0 on IO disabled pci: Validate interfaces on base_class_init xen/pt: Mark TYPE_XEN_PT_DEVICE as hybrid pci: Add INTERFACE_CONVENTIONAL_PCI_DEVICE to Conventional PCI devices pci: Add INTERFACE_PCIE_DEVICE to all PCIe devices pci: Add interface names to hybrid PCI devices pci: conventional-pci-device and pci-express-device interfaces PCI: PCIe access should always be little endian virtio/pci/migration: Convert to VMState hw/pci-bridge/pcie_pci_bridge: properly handle MSI unavailability case pci: allow 32-bit PCI IO accesses to pass through the PCI bridge virtio/vhost: reset dev->log after syncing MAINTAINERS: add Dump maintainers scripts/dump-guest-memory.py: add vmcoreinfo kdump: set vmcoreinfo location ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-10-16Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2017-10-14' into ↵Peter Maydell
staging nbd patches for 2017-10-14 - Marc-André Lureau - NBD: use g_new() family of functions - Vladimir Sementsov-Ogievskiy - first half of 00/13 nbd minimal structured read # gpg: Signature made Sun 15 Oct 2017 01:38:47 BST # gpg: using RSA key 0xA7A16B4A2527436A # 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-nbd-2017-10-14: nbd: header constants indenting nbd/server: simplify reply transmission nbd/server: refactor nbd_co_send_simple_reply parameters nbd/server: do not use NBDReply structure nbd/server: structurize simple reply header sending nbd: rename some simple-request related objects to be _simple_ block/nbd-client: refactor nbd_co_receive_reply block/nbd-client: assert qiov len once in nbd_co_request NBD: use g_new() family of functions Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-10-16tests/prom-env: Bump the timeout, and test pseries only in slow modeThomas Huth
If QEMU has been compiled with the flags --enable-tcg-interpreter and --enable-debug, the guest is running incredibly slow. The prom-env test is approximately 10 times slower than normal in this case, and it takes up to 500 seconds until the test with the pseries machine finishs. While we should still look for ways to speed up the test on the pseries machine here, let's bump the timeout to 600 seconds to allow the test to pass with this unusal configuration already now. Also move the pseries test into the "slow" category - since it is really a very slow test. Reviewed-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Thomas Huth <thuth@redhat.com>
2017-10-16tests: use g_new() family of functionsMarc-André Lureau
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> [PMD: split of some files in other commits of the same series, add libqtest.c] Acked-by: John Snow <jsnow@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
2017-10-15tests/pxe: Test more NICs when running in SPEED=slow modeThomas Huth
The pxe-test is a very good test to excercise NICs, thus we should use it to test all NICs that can be used by the BIOS for booting via network. However, to avoid that the default testing time increases too much, the additional NICs are only tested in the "make check SPEED=slow" mode. The virtio-net NIC on ppc64 is now also only tested in slow mode, since the test on ppc64 is really quite slow and we've got test coverage for virtio-net in big endian mode now on s390x, too. Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-10-12nbd: rename some simple-request related objects to be _simple_Vladimir Sementsov-Ogievskiy
To be consistent when their _structured_ analogs will be introduced. Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20171012095319.136610-4-vsementsov@virtuozzo.com> [eblake: also tweak trace message contents] Signed-off-by: Eric Blake <eblake@redhat.com>
2017-10-12vhost-user-bridge: Only process received packets on started queuesDr. David Alan Gilbert
Only process received packets if the queue has been started. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20171002191521.15748-3-dgilbert@redhat.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2017-10-11scripts: Remove debug parameter from QEMUMachineEduardo Habkost
All scripts that use the QEMUMachine and QEMUQtestMachine classes (device-crash-test, tests/migration/*, iotests.py, basevm.py) already configure logging. The basicConfig() call inside QEMUMachine.__init__() is being kept just to make sure a script would still work if it didn't configure logging. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20171005172013.3098-4-ehabkost@redhat.com> Reviewed-by: Lukáš Doktor <ldoktor@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2017-10-11guestperf: Configure logging on all shell frontendsEduardo Habkost
The logging module will eventually replace the 'debug' parameter in QEMUMachine and QEMUMonitorProtocol. Cc: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20171005172013.3098-2-ehabkost@redhat.com> Reviewed-by: Lukáš Doktor <ldoktor@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2017-10-11basevm: Call logging.basicConfig()Eduardo Habkost
Just setting level=DEBUG when debug is enabled is not enough: we need to set up a log handler if we want debug messages generated using logging.getLogger(...).debug() to be printed. This was not a problem before because logging.debug() calls logging.basicConfig() implicitly, but it's safer to not rely on that. Cc: "Alex Bennée" <alex.bennee@linaro.org> Cc: Fam Zheng <famz@redhat.com> Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20170927130339.21444-4-ehabkost@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Lukáš Doktor <ldoktor@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2017-10-11iotests: Set up Python loggingEduardo Habkost
Set up Python logging module instead of relying on QEMUMachine._debug to enable debugging messages. Cc: Kevin Wolf <kwolf@redhat.com> Cc: Max Reitz <mreitz@redhat.com> Cc: qemu-block@nongnu.org Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20170927130339.21444-3-ehabkost@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Lukáš Doktor <ldoktor@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2017-10-10build-sys: fix libvhost-user.a buildMarc-André Lureau
And actually link to it from vhost-user-bridge. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
2017-10-06iotests: Fix 195 if IMGFMT is part of TEST_DIRMax Reitz
do_run_qemu() in iotest 195 first applies _filter_imgfmt when printing qemu's command line and _filter_testdir only afterwards. Therefore, if the image format is part of the test directory path, _filter_testdir will no longer apply and the actual output will differ from the reference output even in case of success. For example, TEST_DIR might be "/tmp/test-qcow2", in which case _filter_imgfmt first transforms this to "/tmp/test-IMGFMT" which is no longer recognized as the TEST_DIR by _filter_testdir. Fix this by not applying _filter_imgfmt in do_run_qemu() but in run_qemu() instead, and only after _filter_testdir. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20170927211334.3988-1-mreitz@redhat.com Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-10-06iotests: Add test 197 for covering copy-on-readEric Blake
Add a test for qcow2 copy-on-read behavior, including exposure for the just-fixed bugs. The copy-on-read behavior is always to a qcow2 image, but the test is careful to allow running with most image protocol/format combos as the backing file being copied from (luks being the exception, as it is harder to pass the right secret to all the right places). In fact, for './check nbd', this appears to be the first time we've had a qcow2 image wrapping NBD, requiring an additional line in _filter_img_create to match the similar line in _filter_img_info. Invoking blkdebug to prove we don't write too much took some effort to get working; and it requires that $TEST_WRAP (based on $TEST_DIR) not be subject to word splitting. We may decide later to have the entire iotests suite use relative rather than absolute names, to avoid problems inherited by the absolute name of $PWD or $TEST_DIR, at which point the sanity check in this commit could be simplified. This test requires at least 2G of consecutive memory to succeed; as such, it is prone to spurious failures, particularly on 32-bit machines under load. This situation is detected and triggers an early exit to skip the test, rather than a failure. To manually provoke this setup on a beefier machine, I used: $ (ulimit -S -v 1000000; ./check -qcow2 197) Signed-off-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-10-06iotests: Restore stty settings on completionEric Blake
Executing qemu with a terminal as stdin will temporarily alter stty settings on that terminal (for example, disabling echo), because of how we run both the monitor and any multiplexing with guest input. Normally, qemu restores the original settings on exit; but if an iotest triggers qemu to abort in the middle, we can be left with the altered terminal setup. This can make life very annoying when debugging an iotest failure (not everyone remembers the trick of blind-typing 'stty sane' without echo, and some people prefer terminal settings that are slightly different than the defaults picked by 'stty sane'). It is possible to avoid qemu corrupting the terminal by not passing a terminal to qemu's stdin in the first place (as in, use './check ... </dev/null'), but that's extra typing to have to remember. But running 'exec </dev/null' in the harness seems like it might be too heavy of a hammer. So I instead went the the solution of saving and restoring the stty settings, only when the harness detects that it is run interactively. I tested this patch by forcing an allocation failure (I can't guarantee that this particular limit will work on all setups, but it shows the idea): $ (ulimit -S -v 500000; ./check -qcow2 1) Signed-off-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-10-06commit: Remove overlay_bsKevin Wolf
We don't need to make any assumptions about the graph layout above the top node of the commit operation any more. Remove the use of bdrv_find_overlay() and related variables from the commit job code. bdrv_drop_intermediate() doesn't use the 'active' parameter any more, so we can just drop it. The overlay node was previously added to the block job to get a BLK_PERM_GRAPH_MOD. We really need to respect those permissions in bdrv_drop_intermediate() now, but as long as we haven't figured out yet how BLK_PERM_GRAPH_MOD is actually supposed to work, just leave a TODO comment there. With this change, it is now possible to perform another block job on an overlay node without conflicts. qemu-iotests 030 is changed accordingly. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2017-10-06qemu-iotests: Test commit block job where top has two parentsKevin Wolf
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-10-06qemu-iotests: Allow QMP pretty printing in common.qemuKevin Wolf
QMP responses to certain commands can become quite long, which doesn't only make reading them hard, but also means that the maximum line length in patch emails can be exceeded. Allow tests to switch to QMP pretty printing, which results in more, but shorter lines. We also need to make sure to keep indentation in the response for this to work as expected. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2017-10-06qemu-iotests: merge "check" and "common"Paolo Bonzini
"check" is full of qemu-iotests--specific details. Separating it from "common" does not make much sense anymore. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-10-06qemu-iotests: get rid of $iamPaolo Bonzini
The variable is almost unused, and one of the two uses is actually uninitialized. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-10-06qemu-iotests: fix uninitialized variablePaolo Bonzini
The variable is used in "common" but defined only after the file is sourced. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-10-06qemu-iotests: disintegrate more parts of common.configPaolo Bonzini
Split "check" parts from tests part. For the directory setup, the actual computation of directories goes in "check", while the sanity checks go in the tests. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-10-06qemu-iotests: do not include common.rc in "check"Paolo Bonzini
It only provides functions used by the test programs. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>