qemu-iotests: add 053 unaligned compressed image size test
Test that qemu-img convert -c works when input image length is not amultiple of the cluster size.
Previously an error message would be produced:
qemu-img: error while compressing sector 0: Input/output error...
block: Fail gracefully when using a format driver on protocol level
Specifying the wrong driver could fail an assertion:
$ qemu-system-x86_64 -drive file.driver=qcow2,file=xqemu-system-x86_64: block.c:721: bdrv_open_common: Assertion `file !=((void *)0)' failed....
qemu-iotests: Fix _filter_qemu
$QEMU_PROG happens to be 'qemu' in my setup, so this sed commandreplaces a bit too much. Restrict it to the start of the line and towhen it's followed by a colon, i.e. the form used by error messages.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>...
i440fx-test: add test for PAM functionality
This tests PAM settings for the i440fx. This test does a lot ofbyte MMIO which is fairly slow with qtest today. But the testdoes complete in under 2 seconds.
We don't fully emulate PAM largely because of limitations with...
fw_cfg: add qtest test case
This validates some basic characteristics of fw_cfg.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1366123521-4330-8-git-send-email-aliguori@us.ibm.com
i440fx-test: add test to compare default register values
This test compares all of the default register values against thespec. It turns out we deviate in quite a few places. Theseplaces are really only visible to the BIOS though which is whythis hasn't created any problems....
qtest: add libqos including PCI support
This includes basic PCI support for the PC platform. Enoughabstraction should be present to support non-PC platforms too.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1366123521-4330-3-git-send-email-aliguori@us.ibm.com
libqos: add fw_cfg support
fw_cfg is needed to get the top of memory which is necessary fordoing PCI allocation and allocating RAM for DMA.
Add a PC version of fw_cfg and enough abstraction to support otherplatforms.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>...
libqos: add malloc support
This is a very simple allocator for the PC platform. It shouldbe possible to add backends for other platforms.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1366123521-4330-5-git-send-email-aliguori@us.ibm.com
qtest: don't use system command to avoid double fork
Currently we waitpid on the child process we spawn off that doesnothing more than system() another process. While this does notappear to be incorrect, it's wasteful and confusing so get rid ofit.
target-mips: fix mipsdsp_mul_q15_q15 and tests for MAQ_SA_W_PHL/PHR
The operands for MAQ_SA_W.PHL/MAQ_SA_W.PHR must in specified format.Otherwise, the results are unpredictable. Once the operands were correctedin the tests (part of this change), a bug in mipsdsp_mul_q15_q15 became...
qemu-iotests: filter QEMU_PROG in 051.out
Filter the name of the QEMU executable so the output can be diffed nomatter what QEMU_PROG is (e.g. qemu-system-x86_64).
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
iotests: Add 'check -ssh' option to test Secure Shell block device.
Note in order to run these tests on ssh, you must be running a localssh daemon, and that daemon must accept loopback connections, andssh-agent has to be set up to allow logins on the local daemon. In...
qemu-iotests: A few more bdrv_pread/pwrite tests
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
qemu-iotests: Add test for -drive options
qjson: to_json() case QTYPE_QSTRING is buggy, rewrite
Known bugs in to_json():
check-qjson: Test noncharacters other than U+FFFE, U+FFFF in strings
Test cases cover the two noncharacters in the BMP. Add tests for theother 64 noncharacters.
Three existing test cases involve noncharacters U+FFFF and U+10FFFF.Instead of deleting them as now duplicates, adjust them to use U+FFFC...
check-qjson: Improve a few comments, delete bogus ones
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Laszlo Ersek <lersek@redhat.com>Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Merge remote-tracking branch 'bonzini/hw-dirs' into staging
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....
configure: Don't fall back to gthread coroutine backend
The gthread coroutine backend is broken and does not produce a workingQEMU; it is only useful for some very limited debugging situations.Clean up the backend selection logic in configure so that it now runs...
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
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
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/
block: move include files to include/block/