aboutsummaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2014-09-29Merge remote-tracking branch 'remotes/qmp-unstable/queue/qmp' into stagingPeter Maydell5-0/+60
* remotes/qmp-unstable/queue/qmp: Add HMP command "info memory-devices" qemu-socket: Eliminate silly QERR_ macros qemu-socket: Polish errors for connect() and listen() failure qemu-iotests: Test missing "driver" key for blockdev-add tests: add QMP input visitor test for unions with no discriminator qapi: dealloc visitor, implement visit_start_union qapi: add visit_start_union and visit_end_union virtio-balloon: fix integer overflow in memory stats feature monitor: Reset HMP mon->rs in CHR_EVENT_OPEN Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-09-29libqos: use microseconds instead of iterations for virtio timeoutStefan Hajnoczi3-43/+42
Some hosts are slow or overloaded so test execution takes a long time. Test cases use timeouts to protect against an infinite loop stalling the test forever (especially important in automated test setups). Commit 6cd14054b67774cc58a51fca6660cfa1d3c08059 ("libqos virtio: Increase ISR timeout") increased the clock_step() value in an attempt to lengthen the virtio interrupt wait timeout, but timeout failures are still occuring on the Travis automated testing platform. This is because clock_step() only affects the guest's virtual time. Virtio requests can be bottlenecked on host disk I/O latency - which cannot be improved by stepping the clock, so the fix was ineffective. This patch changes the qvirtio_wait_queue_isr() and qvirtio_wait_config_isr() timeout mechanism from loop iterations to microseconds. This way the test case can specify an absolute 30 second timeout. Number of loop iterations is not a reliable timeout mechanism since the speed depends on many factors including host performance. Tests should no longer timeout on overloaded Travis instances. Cc: Marc Marí <marc.mari.barcelo@gmail.com> Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-09-29libqos: improve event_index test with timeoutStefan Hajnoczi3-4/+31
The virtio event_index feature lets the device driver tell the device how many requests to process before raising the next interrupt. virtio-blk-test.c tries to verify that the device does not raise an interrupt unnecessarily. Unfortunately the test has a race condition. It spins checking for an interrupt up to 100 times and then assumes the request has finished. On a slow host the I/O request could still be in flight and the test would fail. This patch waits for the request to complete, or until a 30-second timeout is reached. If an interrupt is raised while waiting the test fails since the device was not supposed to raise interrupts. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-09-29Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into stagingPeter Maydell4-3/+77
Block patches # gpg: Signature made Fri 26 Sep 2014 19:57:52 BST using RSA key ID C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" * remotes/kevin/tags/for-upstream: qemu-iotests: Fail test if explicit test case number is unknown block: Validate node-name vpc: fix beX_to_cpu() and cpu_to_beX() confusion docs: add blkdebug block driver documentation block: Catch simultaneous usage of options and their aliases block: Specify -drive legacy option aliases in array block: Improve message for device name clashing with node name qemu-nbd: Destroy the BlockDriverState properly block: Keep DriveInfo alive until BlockDriverState dies blockdev: Disentangle BlockDriverState and DriveInfo creation blkdebug: show an error for invalid event names Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-09-26qapi: Ignore files created during make checkEric Blake1-0/+3
After an in-tree build and run of 'make check-{qapi-schema,unit}', I noticed some leftover files. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Wenchao Xia <wenchaoqemu@gmail.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-09-26qapi: Consistent whitespace in tests/MakefileEric Blake1-16/+16
tests/Makefile had a mix of TAB vs. 8-space indentation; given that it is a Makefile, TAB is more idiomatic even though in these particular cases the choice of whitespace didn't matter. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-09-26qemu-iotests: Test missing "driver" key for blockdev-addFam Zheng2-0/+30
Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Cc: qemu-stable@nongnu.org Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-09-26tests: add QMP input visitor test for unions with no discriminatorMichael Roth3-0/+30
This is more of an exercise of the dealloc visitor, where it may erroneously use an uninitialized discriminator field as indication that union fields corresponding to that discriminator field/type are present, which can lead to attempts to free random chunks of heap memory. Cc: qemu-stable@nongnu.org Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
2014-09-26tests: avoid running duplicate qom-testsMichael Roth1-1/+2
Since 3687d532 we've been unconditionally adding qom-test to our qtests for every arch. However, some archs inherit their tests from Makefile variables for other archs, such as i386/x86_64, microblaze/microblazeel, and xtensa/xtensaeb. Since these are evaluated in a lazy manner, we ultimately end up adding qom-test twice. In the case x86_64, where we have a large number of machine types that we rerun qom-test for, this has lead to a fairly noticeable increase in the overall run-time of `make check` (78s vs. 42s on my machine). Similar speed-ups are visible for other such archs, but not nearly as significant. Fix this by only adding qom-test to an arch's test list if it's not already present. Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Andreas Färber <afaerber@suse.de> Cc: qemu-stable@nongnu.org Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
2014-09-25qemu-iotests: Fail test if explicit test case number is unknownFam Zheng1-2/+8
When we expand a number range, we just print "$id - unknown test, ignored", this is convenient if we want to run a range of tests. When we designate a test case number explicitly, we shouldn't just ignore it if the case script doesn't exist. Print an error and fail the test. Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-09-25block: Catch simultaneous usage of options and their aliasesKevin Wolf2-0/+68
While thinking about precedence of conflicting block device options from different sources, I noticed that you can specify both an option and its legacy alias at the same time (e.g. readonly=on,read-only=off). Rather than specifying the order of precedence, we should simply forbid such combinations. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Benoît Canet <benoit.canet@nodalink.com> Reviewed-by: Markus Armbruster <armbru@redhat.com>
2014-09-25block: Improve message for device name clashing with node nameMarkus Armbruster1-1/+1
Suggested-by: Benoit Canet <benoit.canet@nodalink.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Benoît Canet <benoit.canet@nodalink.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-09-22async: aio_context_new(): Handle event_notifier_init failureChrysostomos Nanakos3-3/+27
On a system with a low limit of open files the initialization of the event notifier could fail and QEMU exits without printing any error information to the user. The problem can be easily reproduced by enforcing a low limit of open files and start QEMU with enough I/O threads to hit this limit. The same problem raises, without the creation of I/O threads, while QEMU initializes the main event loop by enforcing an even lower limit of open files. This commit adds an error message on failure: # qemu [...] -object iothread,id=iothread0 -object iothread,id=iothread1 qemu: Failed to initialize event notifier: Too many open files in system Signed-off-by: Chrysostomos Nanakos <cnanakos@grnet.gr> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-22block: delete cow block driverStefan Hajnoczi5-12/+5
This patch removes support for the cow file format. Normally we do not break backwards compatibility but in this case there is no impact and it is the most logical option. Extraordinary claims require extraordinary evidence so I will show why removing the cow block driver is the right thing to do. The cow file format is the disk image format for Usermode Linux, a way of running a Linux system in userspace. The performance of UML was never great and it was hacky, but it enjoyed some popularity before hardware virtualization support became mainstream. QEMU's block/cow.c is supposed to read this image file format. Unfortunately the file format was underspecified: 1. Earlier Linux versions used the MAXPATHLEN constant for the backing filename field. The value of MAXPATHLEN can change, so Linux switched to a 4096 literal but QEMU has a 1024 literal. 2. Padding was not used on the header struct (both in the Linux kernel and in QEMU) so the struct layout varied across architectures. In particular, i386 and x86_64 were different due to int64_t alignment differences. Linux now uses __attribute__((packed)), QEMU does not. Therefore: 1. QEMU cow images do not conform to the Linux cow image file format. 2. cow images cannot be shared between different host architectures. This means QEMU cow images are useless and QEMU has not had bug reports from users actually hitting these issues. Let's get rid of this thing, it serves no purpose and no one will be affected. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-id: 1410877464-20481-1-git-send-email-stefanha@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-22ahci: Add test_identify case to ahci-test.John Snow1-0/+304
Utilizing all of the bring-up code in pci_enable and hba_enable, this test issues a simple IDENTIFY command via the HBA and retrieves the response via the PIO receive mechanisms of the HBA. Bugs: The DPS interrupt (Descriptor Processed Status) does not currently get set. This will need to be adjusted in a future patch series when the AHCI DMA pathways are reworked to allow the feature, which may be utilized by OSX guests. Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1408643079-30675-9-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-22ahci: Add test_hba_enable to ahci-test.John Snow1-0/+156
This test engages the HBA functionality and initializes values to sane defaults to allow for minimal HBA functionality. Buffers are allocated and pointers are updated to allow minimal I/O commands to complete as expected. Error registers and responses are sanity checked for specification adherence. Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1408643079-30675-8-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-22ahci: Add test_hba_spec to ahci-test.John Snow1-1/+560
Add a test routine that checks the boot-up values of the HBA configuration memory space against the AHCI 1.3 specification and Intel ICH9 data sheet (for Q35 machines) for adherence and sane values. The HBA is not yet engaged or put into the idle state. [Replaced g_assert_false(...) with g_assert(!...) for glib <2.38 compatibility, reported by Peter Maydell <peter.maydell@linaro.org>. --Stefan] Signed-off-by: John Snow <jsnow@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1408643079-30675-7-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-22ahci: add test_pci_enable to ahci-test.John Snow2-0/+59
This adds a test wherein we engage the PCI AHCI device and ensure that the memory region for the HBA functionality is now accessible. Under Q35 environments, additional PCI configuration is performed to ensure that the HBA functionality will become usable. Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1408643079-30675-5-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-22ahci: Add test_pci_spec to ahci-test.John Snow1-6/+299
Adds a specification adherence test for AHCI where the boot-up values for the PCI configuration space are compared against the AHCI 1.3 specification. This test does not itself attempt to engage the device. Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1408643079-30675-4-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-22ahci: Adding basic functionality qtest.John Snow2-0/+198
Currently, there is no qtest to test the functionality of the AHCI functionality present within the Q35 machine type. This patch adds a skeleton for an AHCI test suite, and adds a simple sanity-check test case where we identify that the AHCI device is present, then disengage the virtual machine. Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1408643079-30675-2-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-22layout: Add generators for refcount table and blocksMaria Kustova1-1/+137
Refcount structures are placed in clusters randomly selected from all unallocated host clusters. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Maria Kustova <maria.k@catit.be> Reviewed-by: Fam Zheng <famz@redhat.com> Message-id: 7e2f38608db6fba2da53997390b19400d445c45d.1408450493.git.maria.k@catit.be Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-22fuzz: Add fuzzing functions for entries of refcount table and blocksMaria Kustova1-1/+15
Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Maria Kustova <maria.k@catit.be> Message-id: c9f4027b6f401c67e9d18f94aed29be445e81d48.1408450493.git.maria.k@catit.be Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-22image-fuzzer: Trivial readability and formatting improvementsMaria Kustova2-31/+28
Signed-off-by: Maria Kustova <maria.k@catit.be> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-22iotests: Add more tests for qcow2 corruptionMax Reitz2-2/+105
Add tests for unaligned L1/L2/reftable entries and non-fatal corruption reports. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1409926039-29044-6-git-send-email-mreitz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-22qcow2: Use qcow2_signal_corruption() for overlapsMax Reitz1-5/+5
Use the new function in case of a failed overlap check. This changes output in case of corruption, so adapt iotest 060's reference output accordingly. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Benoît Canet <benoit.canet@nodalink.com> Message-id: 1409926039-29044-4-git-send-email-mreitz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-22thread-pool: Convert thread_pool_aiocb_info.cancel to cancel_asyncFam Zheng1-8/+26
The .cancel_async shares the same the first half with .cancel: try to steal the request if not submitted yet. In this case set the elem to THREAD_DONE status and ret to -ECANCELED, which means thread_pool_completion_bh will call the cb with -ECANCELED. If the request is already submitted, do nothing, as we know the normal completion will happen in the future. Testing code update: Before, done_cb is only called if the request is already submitted by thread pool. Now done_cb is always called, even before it is submitted, because we emulate bdrv_aio_cancel with bdrv_aio_cancel_async. So also update the test criteria accordingly. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-18Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into stagingPeter Maydell2-11/+150
pci, pc, virtio, misc bugfixes A bunch of bugfixes - some of these will make sense for 2.1.2 I put Cc: qemu-stable included where appropriate. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Thu 18 Sep 2014 19:52:18 BST using RSA key ID D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" * remotes/mst/tags/for_upstream: pc: leave more space for BIOS allocations virtio-pci: fix migration for pci bus master vhost-user: fix VIRTIO_NET_F_MRG_RXBUF negotiation virtio-pci: enable bus master for old guests Revert "virtio: don't call device on !vm_running" virtio-net: drop assert on vm stop Revert "rng-egd: remove redundant free" qdev: Move global validation to a single function qdev: Rename qdev_prop_check_global() to qdev_prop_check_globals() test-qdev-global-props: Test handling of hotpluggable and non-device types test-qdev-global-props: Initialize not_used=true for all props test-qdev-global-props: Run tests on subprocess tests: disable global props test for old glib test-qdev-global-props: Trivial comment fix hw/machine: Free old values of string properties Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-09-18qdev: Move global validation to a single functionEduardo Habkost1-11/+55
Currently GlobalProperty.not_used=false has multiple meanings: * It may be a property for a hotpluggable device, which may or may not have been used by a device; * It may be a machine-type-provided property, which may or may not have been used by a device. * It may be a user-provided property that was actually not used by any device. Simplify the logic by having two separate fields: 'user_provided' and 'used'. This allows the entire global property validation logic to be contained in a single function, and allows more specific error messages. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-09-18qdev: Rename qdev_prop_check_global() to qdev_prop_check_globals()Eduardo Habkost1-1/+1
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-09-18test-qdev-global-props: Test handling of hotpluggable and non-device typesEduardo Habkost1-0/+55
Ensure no warning will be printed for hotpluggable types, and warnings will be printed for non-device types. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-09-18test-qdev-global-props: Initialize not_used=true for all propsEduardo Habkost1-2/+5
This will ensure we are actually testing the code which sets not_used=false when the property is used. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-09-18test-qdev-global-props: Run tests on subprocessEduardo Habkost1-6/+43
There are multiple reasons for running the global property tests on a subprocess: * We need the global_props lists to be empty for each test case, so global properties from the previous test won't affect the next one; * We don't want the qdev_prop_check_global() warnings to pollute test output; * With a subprocess, we can ensure qdev_prop_check_global() is printing the warning messages it should. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-09-18tests: disable global props test for old glibMichael S. Tsirkin1-1/+1
follow-up patch moves global property tests to subprocesses. Unfortunately with old glib this causes: tests/test-qdev-global-props.c: In function ‘test_static_prop’: tests/test-qdev-global-props.c:80:5: error: implicit declaration of function ‘g_test_trap_subprocess’ [-Werror=implicit-function-declaration] tests/test-qdev-global-props.c:80:5: error: nested extern declaration of ‘g_test_trap_subprocess’ [-Werror=nested-externs] This function was only added in glib 2.38, and our minimum version is 2.12. To fix, disable the test for glib < 2.38. Apply before that patch to avoid breaking bisect. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-09-15Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into stagingPeter Maydell8-30/+121
Block patches # gpg: Signature made Fri 12 Sep 2014 16:09:43 BST using RSA key ID C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" * remotes/kevin/tags/for-upstream: (22 commits) qcow2: Add falloc and full preallocation option raw-posix: Add falloc and full preallocation option qapi: introduce PreallocMode and new PreallocModes full and falloc. block: don't convert file size to sector size block: round up file size to nearest sector iotests: Send the correct fd in socket_scm_helper blockdev: Refuse to drive_del something added with blockdev-add block: extend BLOCK_IO_ERROR with reason string dataplane: fix virtio_blk_data_plane_create() op blocker error path qemu-iotests: Run 025 for Archipelago block driver block/archipelago: Implement bdrv_truncate() block: Make the block accounting functions operate on BlockAcctStats block: rename BlockAcctType members to start with BLOCK_ instead of BDRV_ block: Extract the block accounting code block: Extract the BlockAcctStats structure IDE: MMIO IDE device control should be little endian thread-pool: Drop unnecessary includes xen: Drop redundant bdrv_close() from pci_piix3_xen_ide_unplug() xen_disk: Plug memory leak on error path qemu-io: Clean up openfile() after commit 2e40134 ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-09-14test-qdev-global-props: Trivial comment fixEduardo Habkost1-1/+1
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2014-09-12qcow2: Add falloc and full preallocation optionHu Tao1-27/+27
preallocation=falloc allocates disk space by posix_fallocate(), preallocation=full allocates disk space by writing zeros to disk. Both modes imply preallocation=metadata. Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-09-12qapi: introduce PreallocMode and new PreallocModes full and falloc.Hu Tao1-1/+1
This patch prepares for the subsequent patches. Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-09-12block: round up file size to nearest sectorHu Tao4-0/+91
Currently the file size requested by user is rounded down to nearest sector, causing the actual file size could be a bit less than the size user requested. Since some formats (like qcow2) record virtual disk size in bytes, this can make the last few bytes cannot be accessed. This patch fixes it by rounding up file size to nearest sector so that the actual file size is no less than the requested file size. Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-09-12libqos virtio: Increase ISR timeoutMarc Marí1-2/+2
Increase the clock step to avoid Travis failure in some builds due to overagressive timeout. Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com> Message-id: 1410428416-5046-1-git-send-email-marc.mari.barcelo@gmail.com Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2014-09-12iotests: Send the correct fd in socket_scm_helperStratos Psomadakis1-1/+1
Make sure to pass the correct fd via SCM_RIGHTS in socket_scm_helper.c (i.e. fd_to_send, not socket-fd). Signed-off-by: Stratos Psomadakis <psomas@grnet.gr> Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-09-10qemu-iotests: Run 025 for Archipelago block driverChrysostomos Nanakos1-1/+1
Run resize grow test to ensure that existing data is not lost during grow and new space is zeroed. Signed-off-by: Chrysostomos Nanakos <cnanakos@grnet.gr> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2014-09-08qtest/ide: Uninitialize PC allocatorJohn Snow1-0/+2
Use the new call to pc_alloc_uninit as a test for the new pathways. The leak checking / assert pathways are not enabled in this patch, leaving this as an option to future test writers. Signed-off-by: John Snow <jsnow@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-08libqos: add a simple first-fit memory allocatorJohn Snow2-10/+279
Implement a simple first-fit memory allocator that attempts to keep track of leased blocks of memory in order to be able to re-use blocks. Additionally, allow the user to specify when initializing the device that upon cleanup, we would like to assert that there are no blocks in use. This may be useful for identifying problems in qtests that use more complicated set-up and tear-down routines. This functionality is used in my upcoming ahci-test v2 patch set, but I didn't see fit to enable it for any existing tests, which will continue to operate the same as they have prior. Signed-off-by: John Snow <jsnow@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-08libqos: Added EVENT_IDX supportMarc Marí4-1/+156
Added avail_event and NO_NOTIFY check before notifying. Added used_event setting. Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-08libqos: Added MSI-X supportMarc Marí7-62/+426
Added MSI-X support for qtest PCI. Added MSI-X support for virtio-pci. Added MSI-X test case in virtio-blk-test. Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-08libqos: Added test case for configuration changes in virtio-blk testMarc Marí1-0/+34
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-08libqos: Added indirect descriptor support to virtio implementationMarc Marí4-1/+195
Add functions necessary for working with indirect descriptors. Add test using new functions. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-08libqos: Added basic virtqueue support to virtio implementationMarc Marí5-3/+476
Add status changing and feature negotiation. Add basic virtqueue support for adding and sending virtqueue requests. Add ISR checking. [Squashed request endianness fix by Greg Kurz <gkurz@linux.vnet.ibm.com> --Stefan] Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-08tests: Add virtio device initializationMarc Marí8-5/+257
Add functions to read and write virtio header fields. Add status bit setting in virtio-blk-device. Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2014-09-08tests: Functions bus_foreach and device_find from libqos virtio APIMarc Marí5-9/+177
Virtio header has been changed to compile and work with a real device. Functions bus_foreach and device_find have been implemented for PCI. Virtio-blk test case now opens a fake device. Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Marc Marí <marc.mari.barcelo@gmail.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>