qemu-iotests: extract wait_until_completed() into iotests.py
The 'drive-mirror' tests often issue 'block-job-complete' and wait forthe QMP completion event. Other types of block jobs also want to waitfor completion but they may not need to issue 'block-job-complete'....
qemu-iotests: add 055 drive-backup test case
Testing drive-backup is similar to image streaming and drive mirroring.This test case is based on 041.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Revert "block: Disable driver-specific options for 1.5"
This reverts commit 8ec7d390b0d50b5e5b4b1d8dba7ba40d64a70875.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
ide-test: fix failure for test_flush
bd07684aacfb61668ae2c25b7dd00b64f3d7c7f3 added a test to ensure BSYflag is set when a flush request is in flight. It does this by settinga blkdebug breakpoint on flush_to_os before issuing a CMD_FLUSH_CACHE.It then resumes CMD_FLUSH_CACHE operation and checks that BSY is unset....
ide-test: Add FLUSH CACHE test case
This checks in particular that BSY is set while the flush request is inflight.
ide-test: Add enum value for DEV
Get rid of the magic number.
cutils: Support 'P' and 'E' suffixes in strtosz()
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
qemu-iotests: make assert_no_active_block_jobs() common
Tests 030 and 041 both use query-block-jobs to check whether any blockjobs are active. Make this code common so that 'drive-backup' and othernew feature tests will be able to reuse it.
Suggested-by: Kevin Wolf <kwolf@redhat.com>...
qemu-iotests: make cancel_and_wait() common
The cancel_and_wait() function has been duplicated in 030 and 041. Moveit into iotests.py and let it return the event so tests can performadditional asserts.
Note that 041's cancel_and_wait(wait_ready=True) is replaced by...
qemu-iotests: make compare_images() common
The iotests.compare_images() function returns True if two image fileshave the identical data. Previously this was implemented by convertingimages to raw and then comparing their contents using Python. Since"qemu-img compare" is now available and is more efficient, switch to it....
qemu-iotests: make create_image() common
Both 030 and 041 use create_image(). Move it to iotests.py.
Also drop ImageStreamingTestCase since the class now has no methods.
Suggested-by: Kevin Wolf <kwolf@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>...
qemu-iotests: fix 054 cluster size help output
Commit f3f4d2c09b9cf46903ba38425ec46c44185162bd added a hint to increasethe cluster size when a large image cannot be created. Test 054 now hasoutdated output and fails because the golden output does not match....
qapi: pad GenericList value fields to 64 bits
With the introduction of native list types, we now have types such asint64List where the 'value' field is not a pointer, but the actual64-bit value.
On 32-bit architectures, this can lead to situations where 'next' field...
tests: set MALLOC_PERTURB_ to expose memory bugs
glibc wipes malloc(3) memory when the MALLOC_PERTURB_ environmentvariable is set. The value of the environment variable determines thebit pattern used to wipe memory. For more information, seehttp://udrepper.livejournal.com/11429.html....
qcow2.py: Subcommand for changing header fields
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
qemu-iotests: Try creating huge qcow2 image
It's supposed to fail gracefully instead of segfaulting.
qapi: add QMP input test for large integers
Large integers previously got capped to LLONG_MAX/LLONG_MIN so we couldstore them as int64_t. This could lead to silent errors occuring.
Now, we use a double to handle these cases.
Add a test to confirm that QMPInputVisitor handles this as expected if...
qapi: fix visitor serialization tests for numbers/doubles
We never actually stored the stringified double values into the stringsbefore we did the comparisons. This left number/double values completelyuncovered in test-visitor-serialization tests.
Fixing this exposed a bug in our handling of large whole number values...
qapi: add native list coverage for visitor serialization tests
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Reviewed-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Amos Kong <akong@redhat.com>Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
qapi: add native list coverage for QMP output visitor tests
This exercises schema-generated visitors for native list types and doessome sanity checking on validity of serialized data.
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>Reviewed-by: Laszlo Ersek <lersek@redhat.com>...
qapi: add native list coverage for QMP input visitor tests
This exercises schema-generated visitors for native list types and doessome sanity checking on validity of deserialized data.
Merge remote-tracking branch 'mjt/trivial-patches' into staging
target-mips: fix EXTPDP and setting up pos field in the DSPControl reg
This change makes sure that modifications of pos field in the DSPControlregister do not trash other bits in the register. This bug can be triggeredwith the additional test case in mips32-dsp/extpdp.c in this commit....
remove some double-includes
Some source files #include the same header more thanonce for no good reason. Remove second #includes insuch cases.
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
target-mips: fix incorrect behaviour for EXTP
The mask for EXTP instruction when size=31 has not been correctlycalculated.
The test (mips32-dsp/extp.c) has been extended to include the case thattriggers the issue.
Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>...
Merge remote-tracking branch 'luiz/queue/qmp' into staging
Message-id: 1368625179-27962-1-git-send-email-lcapitulino@redhat.com...
ide-test: Fix endianness problems
The test case passes on big endian hosts now (tested on ppc64)
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Message-id: 1368622839-7084-1-git-send-email-kwolf@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
qapi: fix leak in unit tests
qmp_output_get_qobject() increments the qobject's reference count. Sincewe currently pass this straight into qobject_to_json() so we can feedthe data into a QMP input visitor, we never actually free the underlyingqobject when qmp_output_visitor_cleanup() is called. This causes leaks...
Merge remote-tracking branch 'kwolf/for-anthony' into staging
target-mips: fix incorrect behaviour for INSV
Corner case for INSV instruction when size=32 has not been correctlyimplemented. The mask for size should be one bit wider, and preparing thefilter variable should be aware of this case too.
The test for INSV has been extended to include the case that triggers the...
qemu-iotests: fix 017 018 for vmdk
017 and 018 use /bin/mv to move base img from t.IMGFMG to t.IMGFMT.baseafter filling data, this is not enough for vmdk, when t.IMGFMT is only adescription text file who points to t-{flat,s001,f001,...}.IMGFMT asdata extent, so testing such subformats alway fails on them....
libqos/pci: Enable bus mastering
qtest: Add IDE test case
This adds a simple IDE test case and starts by verifying that IDENTIFYcan be successfully used and return the correct serial number, versionand the WCE flag is set for cache=writeback.
qtest/ide-test: Add simple DMA read/write test case
This tests that single sectors can be successfully written and correctlyread back.
qtest/ide-test: Test short and long PRDTs
This tests the behaviour of the DMA engine when the given PRDT containsphysical region descriptors for either more or less bytes than theIDE request is for.
qemu-iotests: exclude vmdk for test 042
Zero sized disk is not supported by qemu vmdk driver, exclude vmdk fromthe test script.
As tested on vmware-vdiskmanager and vmware workstation, zero sized diskis not supported by vmware, either.
Signed-off-by: Fam Zheng <famz@redhat.com>...
qemu-iotests: exclude vmdk and qcow from 043
043 tests recursive backing file by changing backing file. VMDK has notimplemented this yet, and qcow1 probably never will.
Signed-off-by: Fam Zheng <famz@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
libqos: Relocate I2C files
Commit c4efe1cada311b9dc0df5beb71c4227ff3414aa1 (qtest: add libqosincluding PCI support) created a libqos/ subdirectory but left theexisting I2C libqos files libi2c*.[hc] in tests/. Clean this up.
Signed-off-by: Andreas Färber <afaerber@suse.de>...
Merge remote-tracking branch 'stefanha/block' into staging
qemu-iotests: Filter out 'adapter_type'
Filter out vmdk creation option 'adapter_type' for vmdk. So that testswith an explicit './check -o adapter_type=XXX' will not fail.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
target-mips: fix calculation of overflow for SHLL.PH and SHLL.QB
This change corrects and simplifies how discard is calculated for shiftleft logical vector instructions. It is used to detect overflow and set bit22 in the DSPControl register.
The existing tests (shll_ph.c, shll_qb.c) are extended with the corner cases...
qemu-iotests: Filter out vmdk creation options
Cover new image creation options for vmdk, so we can use '-ozeroed_grain=XXX' and '-o subformat=XXX' to run the tests successfully.
Signed-off-by: Fam Zheng <famz@redhat.com>Reviewed-by: Kevin Wolf <kwolf@redhat.com>...
libqtest: only call fclose() on open files
libqtest.c can segfault when calling fclose() if the pidfile wasn'topened successfully. This patch fixes the issue.
Signed-off-by: Jesse Larrew <jlarrew@linux.vnet.ibm.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
libqos: Convert fw_cfg values to host endianness
The fw_cfg ABI is Little Endian, so byte-swap the generically readbyte array to host endianness.
This unbreaks the fw_cfg tests on ppc.
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Andreas Färber <afaerber@suse.de>...
block: Disable driver-specific options for 1.5
We don't want to commit to the API yet before everything is worked out.Disable it for the 1.5 release. This commit is meant to be revertedafter the 1.5 release.
The disabling of the driver-specific options is achieved by applying the...
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).
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
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.
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...
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().
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....