hw: move headers to include/
Many of these should be cleaned up with proper qdev-/QOM-ification.Right now there are many catch-all headers in include/hw/ARCH dependingon cpu.h, and this makes it necessary to compile these files per-target.However, fixing this does not belong in these patches....
test-visitor-serialization: Fix some memory leaks
This patch fixes some of the memory leaks in test-visitor-serialization but not all of them.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
qcow2: Gather clusters in a looping loop
Instead of just checking once in exactly this order if there aredependendies, non-COW clusters and new allocation, this starts loopingaround these. This way we can, for example, gather non-COW clusters afternew allocations as long as the host cluster offsets stay contiguous....
qcow2: Improve check for overlapping allocations
The old code detected an overlapping allocation even when theallocations didn't actually overlap, but were only adjacent.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>...
qemu-iotests: More concurrent allocation scenarios
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
qcow2: Fix "total clusters" number in bdrv_check
This should be based on the virtual disk size, not on the size of theimage.
Interesting observation: With some VM state stored in the image file,percentages higher than 100% are possible, even though snapshots...
Merge branch 'for-upstream' of git://github.com/mwalle/qemu
qemu-iotests: add 052 BDRV_O_SNAPSHOT test
Check that writes to an image opened with BDRV_O_SNAPSHOT do not modifythe underlying image file.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
tests: tcg: lm32: add more test cases
Esp. for testing zero/sign extend in compare operations.
Signed-off-by: Michael Walle <michael@walle.cc>
target-mips: fix rndrashift_short_acc and code for EXTR_ instructions
Fix for rndrashift_short_acc to set correct value to higher 64 bits.This change also corrects conditions when bit 23 of the DSPControl registeris set.
The existing test files have been extended with several examples that...
threadpool: drop global thread pool
Now that each AioContext has a ThreadPool and the main loop AioContextcan be fetched with bdrv_get_aio_context(), we can eliminate the conceptof a global thread pool from thread-pool.c.
The submit functions must take a ThreadPool* argument....
qemu-iotests: add tests for rebasing zero clusters
If zero clusters are erroneously treated as unallocated, "qemu-img rebase" will copy the backing file's contents onto the cluster.
The bug existed also in image streaming, but since the root cause was in...
qemu-iotests: use -nographic in test case 007
A comment explains that -nographic hangs test case 007. This is nolonger the case so add -nographic. This makes the test suite faster andmore pleasant to run since no windows pop up.
I am not sure exactly when -nographic starting working for this case but...
rtc-test: Fix test failures with recent glib
As of glib 2.35.4, glib changed its logic for ordering test cases:
https://bugzilla.gnome.org/show_bug.cgi?id=694487
This was causing failures in rtc-test. Group the reordered testcases into their own suite, which maintains the original ordering....
target-mips: fix DSP overflow macro and affected routines
The previous implementation incorrectly used same macro to detect overflowfor addition and subtraction. This patch makes distinction between thesetwo, and creates separate macros. The affected routines are changed...
Merge remote-tracking branch 'kwolf/for-anthony' into staging
Merge remote-tracking branch 'luiz/queue/qmp' into staging
target-mips: fix for sign-issue in MULQ_W helper
Correct sign-propagation before multiplication in MULQ_W helper.The change also fixes previously incorrect expected values in thetests for MULQ_RS.W and MULQ_S.W.
Signed-off-by: Petar Jovanovic <petarj@mips.com>...
target-mips: fix for incorrect multiplication with MULQ_S.PH
The change corrects sign-related issue with MULQ_S.PH. It also includesextension to the already existing test which will trigger the issue.
Signed-off-by: Petar Jovanovic <petarj@mips.com>Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Merge branch 'eflags3' of git://github.com/rth7680/qemu
qemu-iotests: Add qemu-img compare test
Simple test for qemu-img compare to check it's working correctly.
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>Reviewed-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
qemu-iotests: Test qcow2 image creation options
Just create lots of images and try out each of the creation options thatqcow2 provides (except backing_file/fmt for now)
I'm not totally happy with the behaviour of qemu-img in each of thecases, but let's be explicit and update the test when we do change...
coroutine: trim down nesting level in perf_nesting test
20000 nested coroutines require 20 GB of virtual address space.Only nest 1000 of them so that the test (only enabled with"-m perf" on the command line) runs on 32-bit machines too.
Cc: qemu-stable@nongnu.org...
qemu-img: add compressed clusters to BlockFragInfo
Show how many clusters are compressed. This can be used to monitor howmany compressed clusters remain and whether to recompress the image.
Suggested-by: Cole Robinson <crobinso@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
qemu-img: find the image end offset during check
This patch adds the support for reporting the image end offset (inbytes). This is particularly useful after a conversion (or a rebase)where the destination is a block device in order to find the firstunused byte at the end of the image....
check-qjson: More thorough testing of UTF-8 in strings
Test cases are scraped from Markus Kuhn's UTF-8 decoder capability andstress test athttp://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
Unfortunately, both JSON parser and formatter misbehave right now....
Merge remote-tracking branch 'stefanha/trivial-patches' into staging
Add some missing qtest binaries to .gitignore
These binaries are generated during make check on at least someconfigurations, so att them to .gitignore.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
test-i386: make it compile with a recent gcc
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Richard Henderson <rth@twiddle.net>
test-i386: QEMU_PACKED is not defined here
rtc-test: always set register B in its entirety
Eliminate dependencies between one test and the others.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Message-id: 1357922817-17584-2-git-send-email-pbonzini@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
rtc-test: add testcases for alarms in 12hour mode
Trying (unsuccessfully) to break the device model as mentioned inhttps://bugs.launchpad.net/qemu/+bug/1090558.
At least if someone tries to fix that, it won't break what works...
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
qtest: Add MMIO support
Introduce [qtest_]{read,write}[bwlq]() libqtest functions andcorresponding QTest protocol commands to replace local versions inlibi2c-omap.c.
Also convert m48t59-test's cmos_{read,write}_mmio() to {read,write}b().
Signed-off-by: Andreas Färber <afaerber@suse.de>...
libqtest: Convert macros to functions and clean up documentation
libqtest.h provides a number of shortcut macros to avoid tests feedingit the QTestState they operate on. Most of these can easily be turnedinto static inline functions, so let's do that for clarity....
libqtest: Introduce qtest_qmpv() and convert remaining macro
In order to convert qmp() macro to an inline function, expose aqtest_qmpv() function, reused by qtest_qmp().
We can't apply GCC_FMT_ATTR() since fdc-test is using zero-length formatstrings, which would result in warnings treated as errors....
tests: Add unit tests for mulu64 and muls64
Signed-off-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
libi2c-omap: Fix endianness dependency
The libqos driver for omap_i2c currently does not work on Big Endian.Introduce helpers for reading from and writing to 16-bit armel registers.
This fixes tmp105-test failures on ppc.
To prepare for a QTest-level endianness solution, poison mem{read,write}...
libqtest: Fix documentation copy&paste errors
The [qtest_]in[bwl]() functions/macros don't have a value argument.
Signed-off-by: Andreas Färber <afaerber@suse.de>Message-id: 1360604139-16797-1-git-send-email-afaerber@suse.deSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
tests/test-string-input-visitor: Handle errors provoked by fuzz test
It's OK and expected for visitors to return errors when presented withthe fuzz test's random data. Since the fuzzer doesn't care abouterrors, we pass in NULL rather than an Error**. This fixes a bug in...
cutils: unsigned int parsing functions
There are lots of duplicate parsing code using strto*() in QEMU, andmost of that code is broken in one way or another. Even the visitorscode have duplicate integer parsing code1. This introduces functionsto help parsing unsigned int values: parse_uint() and parse_uint_full()....
sparc: disable qtest in make check
We've seen this repeatedly in buildbot but I can now reliablyreproduce it myself too. With a few hundred runs of 'make check',qemu-system-sparc will hang consuming 100% CPU. I've attached GDBto the hung process and unfortunately, I can't get anything useful...
Merge remote-tracking branch 'stefanha/block' into staging
libqtest: Wait for the right child PID after killing QEMU
When running "make check" with gcov enabled, we get the followingmessage:
hw/tmp105.gcda:cannot open data file, assuming not executed
The problem happens because:
qemu-iotests: Add regression test for b7ab0fea
It turned out that the change in b7ab0fea was actually a real qcow2corruption fix. This is a reproducer for the bug.
block: Adds mirroring tests for resized images
This test verifies two mirroring issues are fixed with resized images:
Add XBZRLE testing
Signed-off-by: Orit Wasserman <owasserm@redhat.com>Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>
target-mips: fix incorrect test for MTHLIP
The pos field in the DSPControl register is not correctly initialized.Per documentation, the result of MTHLIP is unpredictable if the value of thepos field before the execution is greater than 32.
tests: Fix {rtc, m48t59}-test build on illumos
Struct tm does not have tm_gmtoff field on illumos.Fix the build by not zero-initializing these fields on Solaris.
Cc: qemu-stable@nongnu.orgSigned-off-by: Andreas Färber <andreas.faerber@web.de>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Merge remote-tracking branch 'afaerber/qom-cpu' into staging
target-i386: Topology & APIC ID utility functions
This introduces utility functions for the APIC ID calculation, based on: Intel® 64 Architecture Processor Topology Enumeration http://software.intel.com/en-us/articles/intel-64-architecture-processor-topology-enumeration/...
tests: Add gcov support for x86_64 qtest
Since x86_64 is a superset of i386 and reuses all its test cases, adoptall the i386 gcov source files as well, substituting their pathsappropriately.
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
tests: Add gcov support for sparc64 qtest
m48t59-test is individually being executed for sparc and sparc64, so addthe gcov source file for sparc64 as well.
tests: Fix gcov typo for tmp105-test
Commit 6e9989034b176a8e4cfdccd85892abfa73977ba7 introduced a new qtesttest case but misspelled gcov, leading to no coverage analysis. Fix it.
tests: add fuzzing to visitor tests
Perform input tests on random data.
Improvement to code coverage for qapi/string-input-visitor.cis about 3 percentage points.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
tests: adjust gcov variables for directory movement
I had missed the introduction of the gcov-files-* variables.
Cc: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
hbitmap: add assertion on hbitmap_iter_init
hbitmap_iter_init causes an out-of-bounds access when the "first" argument is or greater than or equal to the size of the bitmap.Forbid this with an assertion, and remove the failing testcase.
Reported-by: Kevin Wolf <kwolf@redhat.com>...
mirror: add buf-size argument to drive-mirror
This makes sense when the next commit starts using the extra buffer spaceto perform many I/O operations asynchronously.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
mirror: perform COW if the cluster size is bigger than the granularity
When mirroring runs, the backing files for the target may not yet beready. However, this means that a copy-on-write operation on the targetwould fill the missing sectors with zeros. Copy-on-write only happens...
add hierarchical bitmap data type and test cases
HBitmaps provides an array of bits. The bits are stored as usual in anarray of unsigned longs, but HBitmap is also optimized to provide fastiteration over set bits; going from one bit to the next is O(logB n)...
aio: Fix return value of aio_poll()
aio_poll() must return true if any work is still pending, even if itdidn't make progress, so that bdrv_drain_all() doesn't stop waiting tooearly. The possibility of stopping early occasionally lead to a failedassertion in bdrv_drain_all(), when some in-flight request was missed...
libqtest: Prepare I2C libqos
This adds a simple I2C API and a driver implementation for omap_i2c.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
tests: Add tmp105 qtest test case
Exercise all four commands of the TMP105, testing for an issue in theI2C TX path.
The test case uses the N800's OMAP I2C and is the first for ARM.
Signed-off-by: Andreas Färber <andreas.faerber@web.de>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
build: move QAPI definitions for QEMU out of qapi-obj-y
There is no reason why for example qemu-ga should include all thedefinitions for the QEMU monitor. However, there are a fewthat are needed (qapi_free_SocketAddress, qapi_free_InetSocketAddress,ErrorClass_lookup). These should be moved to a separate "core"...
build: move base QAPI files to libqemuutil.a
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
build: fold trace-obj-y into libqemuutil.a
build: rename oslib-obj-y to util-obj-y
This prepares the creation of libqemuutil.a in the next patch.
build: move util-obj-y to libqemuutil.a
Use a static library to eliminate repetition in the linking rules.
build: move files away from tools-obj-y, common-obj-y, user-obj-y
Split them between libqemuutil.a and, for those used by qemu-img/io/nbd,block-obj-y.
Static libraries ensure that binaries such as qemu-ga do not includeunused modules.
build: move qobject files to qobject/ and libqemuutil.a
stubs: fully replace qemu-tool.c and qemu-user.c
rtc-test: skip year-2038 overflow check in case time_t is 32bit only
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
m48t59-test: don't touch watchdog
target-mips: Fix helper and tests for dot/cross-dot product instructions
Helper function for dpa_w_ph, dpax_w_ph, dps_w_ph and dpsx_w_ph incorrectlydefines halfword vector elements as unsigned values. This results in wrongoutput which is not triggered in the tests as they also follow this logic....
tests: add gcov support
Add support for compiling for GCOV test coverage, enabledwith '--enable-gcov' during configure.
Test coverage will be reported after each test.
test-iov: add iov_discard_front/back() testcases
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
target-mips: Fix for helpers for EXTR_* instructions
The change removes some unnecessary and incorrect code for EXTR_S.H.Further, it corrects the mask for shift value in the EXTR_ instructions. It alsoextends the existing tests so they trigger the issues corrected with the change....
target-mips: Fix incorrect reads and writes to DSPControl register
Upper 4 bits of ccond (bits 31..28 ) of DSPControl register are not used inthe MIPS32 architecture. They are used in the MIPS64 architecture. For MIPS32these bits must be written as zero, and return zero on read....
misc: move include files to include/qemu/
janitor: add guards to headers
qapi: move include files to include/qobject/
block: move include files to include/block/
qapi: move inclusions of qemu-common.h from headers to .c files
qemu-iotests: Test concurrent cluster allocations
This adds some first tests for qcow2's dependency handling when twoparallel write requests access the same cluster.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
tests: Add tests for fdsets
Signed-off-by: Corey Bryant <coreyb@linux.vnet.ibm.com>Reviewed-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
tests: use aio_poll() instead of aio_flush() in test-aio.c
There has been confusion between various aio wait and flush functions.It's time to get rid of qemu_aio_flush() but in the aio test cases wereally do want this low-level functionality.
Therefore declare a local wait_for_aio() helper for the test cases....
tests: avoid qemu_aio_flush() in test-thread-pool.c
We need to eliminate calls to qemu_aio_flush() since the function isbeing removed. Most callers will use bdrv_drain_all() instead buttest-thread-pool.c is lower level.
Since the test uses the global AioContext we can loop on qemu_aio_wait()...
target-xtensa: add SR accessibility unit tests
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
target-xtensa: add s32c1i unit tests
Fix spelling in comments and documentation
These spelling bugs were found by codespell:
supressing -> suppressingtransfered -> transferred
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
target-mips: Fix incorrect shift for SHILO and SHILOV
helper_shilo has not been shifting an accumulator value correctly for negativevalues in 'shift' field. Minor optimization for shift=0 case.This change also adds tests that will trigger issue and check for regressions....
target-mips: Fix incorrect code and test for INSV
Content of register rs should be shifted for pos before applying a mask.This change contains both fix for the instruction and to the existing test.
Signed-off-by: Petar Jovanovic <petarj@mips.com>Reviewed-by: Eric Johnson <ericj@mips.com>...
rtc: Only call rtc_set_cmos when Register B SET flag is disabled.
This bug occurs when the SET flag of Register B is enabled. When an RTCdata register (i.e. any of the ten time/calender CMOS bytes) is set, thedata is (as expected) correctly stored in the cmos_data array. However,...
tests: make threadpool cancellation test looser
The cancellation test is failing on the buildbots. While the failuremerits a little more investigation to understand what is going on,the logs show that the failure is not impacting the coverageprovided by the test. Hence, loosen a bit the assertions in a...
tests: add AioContext unit tests
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
tests: add thread pool unit tests
Merge remote-tracking branch 'bonzini/build-urgent' into staging
tests: link in stubs
fdc-tests: add tests for VERIFY command
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>Signed-off-by: Kevin Wolf <kwolf@redhat.com>