Merge branch 'trivial-patches' of git://git.corpit.ru/qemu
target-mips: fix mipsdsp_mul_q31_q31
Multiplication of two fractional word elements is not correct when signextension/promotion is needed. This change fixes it by adding correctcasts from unsigned to signed values.In addition, the tests (dpaq_sa_l_w.c and dpsq_sa_l_w.c) have been extended...
target-mips: fix mipsdsp_trunc16_sat16_round
This change corrects rounding and saturation of Q31 fractional value inmipsdsp_trunc16_sat16_round(). Overflow detection was incorrect for thecorner case for PRECRQ_RS.PH, and this test case is also part of the change....
target-mips: fix multiplication in mipsdsp_rndq15_mul_q15_q15
Multiplication of Q15 fractional halfword vectors was incorrect in theprevious implementation of mipsdsp_rndq15_mul_q15_q15. It failed to takeelement signs into account. This change fixes it, and it adds a test case...
misc: Use g_assert_not_reached for code which is expected to be unreachable
The macro g_assert_not_reached is a better self documenting replacementfor assert(0) or assert(false).
Signed-off-by: Stefan Weil <sw@weilnetz.de>Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Add tests for sync modes 'TOP' and 'NONE'
This patch adds tests for sync modes top and none. Test for 'TOP'is separated out as it requires a backing file. Also added a testfor invalid format.
Signed-off-by: Ian Main <imain@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
blockdev: Rename 'readonly' option to 'read-only'
Option name cleanup before it becomes a QMP API.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>
qcow2: Use dashes instead of underscores in options
This is what QMP wants to use. The options haven't been enabled in anyrelease yet, so we're still free to change them.
qtest: add test for ISA I/O space endianness
This writes a register and reads its 1/2/4 byte parts. Maskingis done in the device model.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1374501278-31549-25-git-send-email-pbonzini@redhat.com...
pc-testdev: add I/O port to test memory.c auto split/combine
The ports at 0xe8..0xeb have impl.min/max_access_size == 1, sothat memory accesses are split and combined by the memory core.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>...
tests: Add test-bitops.c with some sextract tests
Add some simple test cases for the new sextract32and sextract64 functions.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>Reviewed-by: Richard Henderson <rth@twiddle.net>Message-id: 1372419632-5521-3-git-send-email-peter.maydell@linaro.org...
boot-order-test: Better separate target-specific and generic parts
The initial version did just PC. I didn't bother to separate outgeneric parts, because I don't like to abstract from a single case.
Now we have two cases, PC and PowerMac, and I'm about to add more....
boot-order-test: Code motion for better readability
Cc: Andreas Färber <afaerber@suse.de>Cc: Alexander Graf <agraf@suse.de>Cc: qemu-ppc@nongnu.orgSigned-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1372254743-15808-9-git-send-email-armbru@redhat.com...
boot-order-test: Add tests for PowerPC PREP
Cc: Andreas Färber <afaerber@suse.de>Cc: Alexander Graf <agraf@suse.de>Cc: qemu-ppc@nongnu.orgSigned-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1372254743-15808-10-git-send-email-armbru@redhat.com...
boot-order-test: Add tests for Sun4m
Cc: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1372254743-15808-11-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
libqos: Generalize I/O-mapped fw_cfg
Provide a constructor that takes the base address in addition to thePC-specific one.
Signed-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1372254743-15808-12-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
boot-order-test: Add tests for Sun4u
Cc: Blue Swirl <blauwirbel@gmail.com>Signed-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1372254743-15808-13-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
boot-order-test: New; covering just PC for now
Signed-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1372254743-15808-3-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
libqos: include dependencies
Otherwise rebuilds can fail when libqos is modified.
Reported-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1372254743-15808-4-git-send-email-armbru@redhat.com...
libqos: Add support for memory-mapped fw_cfg
Signed-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1372254743-15808-5-git-send-email-armbru@redhat.comSigned-off-by: Anthony Liguori <aliguori@us.ibm.com>
boot-order-test: Add tests for PowerMacs
They set the boot device via fw_cfg, which is then translated to a bootpath of "hd" or "cd" in OpenBIOS.
Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Andreas Färber <afaerber@suse.de>Signed-off-by: Markus Armbruster <armbru@redhat.com>...
boot-order-test: Cover -boot once in ppc tests
Cc: Andreas Färber <afaerber@suse.de>Cc: Alexander Graf <agraf@suse.de>Cc: qemu-ppc@nongnu.orgSigned-off-by: Markus Armbruster <armbru@redhat.com>Message-id: 1372254743-15808-7-git-send-email-armbru@redhat.com...
libqtest: New qtest_end() to go with qtest_start()
Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Message-id: 1371711329-9144-3-git-send-email-armbru@redhat.com...
libqtest: Plug fd and memory leaks in qtest_quit()
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>Signed-off-by: Markus Armbruster <armbru@redhat.com>Reviewed-by: Andreas Färber <afaerber@suse.de>Message-id: 1371711329-9144-2-git-send-email-armbru@redhat.com...
blockdev: add sync mode to drive-backup QMP command
The drive-backup command is similar to the drive-mirror command, exceptno guest data written after the command executes gets copied. Add async mode argument which determines whether the entire disk is copied,...
block: Don't parse protocol from file.filename
One of the major reasons for doing something new for -blockdev andblockdev-add was that the old block layer code parses filenames insteadof just taking them literally. So we should really leave it untouched...
qemu-iotests: Update 051 reference output
This has been broken by commit bd5c51ee.
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
add a header file for atomic operations
We're already using them in several places, but __sync builtins are justtoo ugly to type, and do not provide seqcst load/store operations.
Reviewed-by: Richard Henderson <rth@twiddle.net>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
int128: optimize and add test cases
For add, the carry only requires checking one of the arguments.For sub and neg, we can similarly optimize computation of thecarry.
For ge, we can just do lexicographic order.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
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
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...