summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2017-04-11block: Use bdrv_coroutine_enter to start I/O coroutinesFam Zheng1-5/+5
BDRV_POLL_WHILE waits for the started I/O by releasing bs's ctx then polling the main context, which relies on the yielded coroutine continuing on bs->ctx before notifying qemu_aio_context with bdrv_wakeup(). Thus, using qemu_coroutine_enter to start I/O is wrong because if the coroutine is entered from main loop, co->ctx will be qemu_aio_context, as a result of the "release, poll, acquire" loop of BDRV_POLL_WHILE, race conditions happen when both main thread and the iothread access the same BDS: main loop iothread ----------------------------------------------------------------------- blockdev_snapshot aio_context_acquire(bs->ctx) virtio_scsi_data_plane_handle_cmd bdrv_drained_begin(bs->ctx) bdrv_flush(bs) bdrv_co_flush(bs) aio_context_acquire(bs->ctx).enter ... qemu_coroutine_yield(co) BDRV_POLL_WHILE() aio_context_release(bs->ctx) aio_context_acquire(bs->ctx).return ... aio_co_wake(co) aio_poll(qemu_aio_context) ... co_schedule_bh_cb() ... qemu_coroutine_enter(co) ... /* (A) bdrv_co_flush(bs) /* (B) I/O on bs */ continues... */ aio_context_release(bs->ctx) aio_context_acquire(bs->ctx) Note that in above case, bdrv_drained_begin() doesn't do the "release, poll, acquire" in BDRV_POLL_WHILE, because bs->in_flight == 0. Fix this by using bdrv_coroutine_enter and enter coroutine in the right context. iotests 109 output is updated because the coroutine reenter flow during mirror job complete is different (now through co_queue_wakeup, instead of the unconditional qemu_coroutine_switch before), making the end job len different. Signed-off-by: Fam Zheng <famz@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
2017-04-11tests/block-job-txn: Don't start block job before adding to txnFam Zheng1-1/+5
Previously, before test_block_job_start returns, the job can already complete, as a result, the transactional state of other jobs added to the same txn later cannot be handled correctly. Move the block_job_start() calls to callers after block_job_txn_add_job() calls. Signed-off-by: Fam Zheng <famz@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
2017-04-07iotests: Add mirror tests for orphaned sourceMax Reitz3-2/+63
Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-04-04io: fix incoming client socket initializationWang guang1-0/+8
The channel socket was initialized manually, but forgot to set QIO_CHANNEL_FEATURE_SHUTDOWN. Thus, the colo_process_incoming_thread would hang at recvmsg. This patch just call qio_channel_socket_new to get channel, Which set QIO_CHANNEL_FEATURE_SHUTDOWN already. Signed-off-by: Wang Guang<wang.guang55@zte.com.cn> Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2017-04-03tests/libqtest.c: Delete possible stale unix socketsPeter Maydell1-0/+8
Occasionally if a test crashes or is interrupted by the user at the wrong moment it could leave behind a stale UNIX socket in /tmp/. This will then cause a subsequent test run to fail spuriously with tests/libqtest.c:70:init_socket: assertion failed (ret != -1): (-1 != -1) if it happens to reuse the same PID. Defend against this by deleting any stray stale socket before trying to open the new ones for this test. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1490963801-27870-1-git-send-email-peter.maydell@linaro.org
2017-04-03iotests: Improve image-clear tests on non-aligned imageEric Blake4-36/+108
Tweak 097 and 176 to operate on an image that is not cluster-aligned, to give further coverage of clearing out an entire image, including the recent fix to eliminate the difference between fast path (97) and slow (176) for qcow2. Also tested on qcow (97 only, since qcow lacks snapshots). Signed-off-by: Eric Blake <eblake@redhat.com> Message-id: 20170331185356.2479-4-eblake@redhat.com Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-04-03iotests: fix 097 when run with qcowDaniel P. Berrange5-130/+251
The previous commit: commit a3e1505daec31ef56f0489f8c8fff1b8e4ca92bd Author: Eric Blake <eblake@redhat.com> Date: Mon Dec 5 09:49:34 2016 -0600 qcow2: Don't strand clusters near 2G intervals during commit extended the 097 test case so that it did two passes, once with an internal snapshot, once without. qcow (v1) does not support internal snapshots, so this change broke test 097 when run against qcow. This splits 097 in two, creating a new 176 that tests the internal snapshot codepath, effectively putting 097 back to its content before the above commit. Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-Id: <20170221115512.21918-8-berrange@redhat.com> [eblake: test collisions: s/173/176/g] Signed-off-by: Eric Blake <eblake@redhat.com> Message-id: 20170331185356.2479-2-eblake@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-04-03nbd: Tidy up blockdev-add interfaceMarkus Armbruster1-8/+17
SocketAddress is a simple union, and simple unions are awkward: they have their variant members wrapped in a "data" object on the wire, and require additional indirections in C. I intend to limit its use to existing external interfaces, and convert all internal interfaces to SocketAddressFlat. BlockdevOptionsNbd is an external interface using SocketAddress. We already use SocketAddressFlat elsewhere in blockdev-add. Replace it by SocketAddressFlat while we can (it's new in 2.9) for simplicity and consistency. For example, { "execute": "blockdev-add", "arguments": { "node-name": "foo", "driver": "nbd", "server": { "type": "inet", "data": { "host": "localhost", "port": "12345" } } } } becomes { "execute": "blockdev-add", "arguments": { "node-name": "foo", "driver": "nbd", "server": { "type": "inet", "host": "localhost", "port": "12345" } } } Since the internal interfaces still take SocketAddress, this requires conversion function socket_address_crumple(). It'll go away when I update the interfaces. Unfortunately, SocketAddress is also visible in -drive since 2.8: -drive if=none,driver=nbd,server.type=inet,server.data.host=127.0.0.1,server.data.port=12345 Nobody should be using it, as it's fairly new and has never been documented, so adding still more compatibility gunk to keep it working isn't worth the trouble. You now have to use -drive if=none,driver=nbd,server.type=inet,server.host=127.0.0.1,server.port=12345 Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-id: 1490895797-29094-9-git-send-email-armbru@redhat.com [mreitz: Change iotest 147 accordingly] Because of this interface change, iotest 147 has to be adapted. Unfortunately, we cannot just flatten all of the addresses because nbd-server-start still takes a plain SocketAddress. Therefore, we need both and this is most easily achieved by writing the SocketAddress into the code and flattening it where necessary. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20170330221243.17333-1-mreitz@redhat.com Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
2017-03-30tests/acpi: don't pack a structureMichael S. Tsirkin1-1/+1
There's no reason to pack structures where we don't care about size or padding, this applies to AcpiStdTable in tests/acpi-utils.h. OTOH bios-tables-test happens to be passing the address of a field in this struct to a function that expects a pointer to normally aligned data which results in a SIGBUS on architectures like SPARC that have strict alignment requirements. Fixes: 9e8458c02 ("acpi unit-test: compare DSDT and SSDT tables against expected values") Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Tested-by: Peter Maydell <peter.maydell@linaro.org>
2017-03-28block: Declare blockdev-add and blockdev-del supportedMarkus Armbruster3-7/+7
It's been a long journey, but here we are. The supported blockdev-add is not compatible to its experimental predecessors; bump all Since: tags to 2.9. x-blockdev-remove-medium, x-blockdev-insert-medium and x-blockdev-change need a bit more work, so leave them alone for now. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2017-03-27tests/virtio-9p-test: Don't call le*_to_cpus on fields of packed structPeter Maydell1-2/+2
For a packed struct like 'P9Hdr' the fields within it may not be aligned as much as the natural alignment for their types. This means it is not valid to pass the address of such a field to a function like le32_to_cpus() which operate on uint32_t* and assume alignment. Doing this results in a SIGBUS on hosts like SPARC which have strict alignment requirements. Use ldl_le_p() instead, which is specified to correctly handle unaligned pointers. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Greg Kurz <groug@kaod.org> Signed-off-by: Greg Kurz <groug@kaod.org>
2017-03-24boot-serial-test: use -no-shutdownChristian Borntraeger1-2/+2
a qemu with an empty s390 guest will exit very quickly. This races against the testsuite reading from the console pipe leading to intermittent test suite failures. Using -no-shutdown will keep the guest running. Fixes: 864111f422ba (vl: exit qemu on guest panic if -no-shutdown is not set) Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Message-id: 1490361570-288658-1-git-send-email-borntraeger@de.ibm.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-03-22qapi: Fix QemuOpts visitor regression on unvisited inputEric Blake1-5/+8
An off-by-one in commit 15c2f669e meant that we were failing to check for unparsed input in all QemuOpts visitors. Recent testsuite additions show that fixing the obvious bug with bogus fields will also fix the case of an incomplete list visit; update the tests to match the new behavior. Simple testcase: ./x86_64-softmmu/qemu-system-x86_64 -nodefaults -nographic -qmp stdio -numa node,size=1g failed to diagnose that 'size' is not a valid argument to -numa, and now once again reports: qemu-system-x86_64: -numa node,size=1g: Invalid parameter 'size' See also https://bugzilla.redhat.com/show_bug.cgi?id=1434666 CC: qemu-stable@nongnu.org Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Tested-by: Laurent Vivier <lvivier@redhat.com> Message-Id: <20170322144525.18964-4-eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-03-22tests: Expose regression in QemuOpts visitorEric Blake1-0/+20
Commit 15c2f669e broke the ability of the QemuOpts visitor to flag extra input parameters, but the regression went unnoticed because of missing testsuite coverage. Add a test to cover this; take the approach already used in 9cb8ef3 of adding a test that passes (to avoid breaking bisection) but marks with BUG the behavior that we don't like, so that the actual impact of the fix in a later patch is easier to see. CC: qemu-stable@nongnu.org Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Message-Id: <20170322144525.18964-2-eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-03-21test-qobject-input-visitor: Cover visit_type_uint64()Markus Armbruster1-0/+30
The new test demonstrates known bugs: integers between INT64_MAX+1 and UINT64_MAX rejected, and integers between INT64_MIN and -1 are accepted modulo 2^64. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1490118290-6133-1-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2017-03-21qapi: Fix string input visitor regression for empty listsMarkus Armbruster1-3/+8
Visiting a list when input is the empty string should result in an empty list, not an error. Noticed when commit 3d089ce belatedly added tests, but simply accepted as weird then. It's actually a regression: broken in commit 74f24cb, v2.7.0. Fix it, and throw in another test case for empty string. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1490026424-11330-2-git-send-email-armbru@redhat.com> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2017-03-21qapi2texi: Fix translation of *strong* and _emphasized_Markus Armbruster1-4/+4
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1490015515-25851-7-git-send-email-armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-03-21tests/qapi-schema: Systematic positive doc comment testsMarkus Armbruster6-4/+537
We have a number of negative tests, but we don't have systematic positive coverage. Fix that. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1490015515-25851-6-git-send-email-armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-03-21tests/qapi-schema: Make test-qapi.py print docs againMarkus Armbruster1-0/+11
test-qapi.py used to print the internal representation of doc comments (commit 3313b61). This went away when we dropped the doc comments in positive tests (commit 87c16dc). Bring it back, because I'm going to add real positive doc comment tests. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1490015515-25851-5-git-send-email-armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2017-03-21test-keyval: Cover alternate and 'any' typeMarkus Armbruster2-1/+54
Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1490014548-15083-4-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2017-03-21test-keyval: Tweaks to improve list coverageMarkus Armbruster1-3/+3
We have a negative test case for a list index with leading zero. Add positive ones. Tweak the test case for list index greater or equal the number of elements: test "equal" instead of "greater" to guard against off-by-one mistakes. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1490014548-15083-2-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2017-03-16Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' ↵Peter Maydell1-1/+1
into staging Pull request Tracing makefile fixes for QEMU 2.9. # gpg: Signature made Thu 16 Mar 2017 06:56:10 GMT # gpg: using RSA key 0x9CA4ABB381AB73C8 # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" # gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>" # Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8 * remotes/stefanha/tags/tracing-pull-request: trace: ensure $(tracetool-y) is defined in top level makefile makefile: generate trace-events-all upfront makefile: merge GENERATED_HEADERS & GENERATED_SOURCES variables Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-03-16qapi: Fix a misleading parser error messageMarkus Armbruster1-1/+1
When choking on a token where an expression is expected, we report 'Expected "{", "[" or string'. Close, but no cigar. Fix it to Expected '"{", "[", string, boolean or "null"'. Missed in commit e53188a. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-48-git-send-email-armbru@redhat.com>
2017-03-16qapi: Fix detection of bogus member documentationMarkus Armbruster3-12/+2
check_definition_doc() checks for member documentation without a matching member. It laboriously second-guesses what members QAPISchema._def_exprs() will create. That's a stupid game. Move the check into QAPISchema.check(), where the members are known. Delegate the actual checking to new QAPIDoc.check(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-38-git-send-email-armbru@redhat.com>
2017-03-16tests/qapi-schema: Improve coverage of bogus member docsMarkus Armbruster9-0/+44
New test doc-bad-union-member.json shows we can fail to reject documentation for nonexistent members. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-37-git-send-email-armbru@redhat.com>
2017-03-16tests/qapi-schema: Rename doc-bad-args to doc-bad-command-argMarkus Armbruster6-2/+2
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-36-git-send-email-armbru@redhat.com>
2017-03-16qapi: Move empty doc section checking to doc parserMarkus Armbruster1-1/+1
Results in a more precise error location, but the real reason is emptying out check_docs() step by step. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-35-git-send-email-armbru@redhat.com>
2017-03-16qapi: Improve error message on @NAME: in free-form docMarkus Armbruster1-1/+1
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-34-git-send-email-armbru@redhat.com>
2017-03-16qapi: Move detection of doc / expression name mismatchMarkus Armbruster1-1/+1
Move the check whether the doc matches the expression name from check_definition_doc() to check_exprs(). This changes the error location from the comment to the expression. Makes sense as the message talks about the expression: "Definition of '%s' follows documentation for '%s'". It's also a step towards getting rid of check_docs(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-33-git-send-email-armbru@redhat.com>
2017-03-16qapi: Fix detection of doc / expression mismatchMarkus Armbruster11-15/+6
This fixes the errors uncovered by the previous commit. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-32-git-send-email-armbru@redhat.com>
2017-03-16tests/qapi-schema: Improve doc / expression mismatch coverageMarkus Armbruster13-0/+38
New tests doc-before-include.json and doc-before-pragma.json show we fail to reject a misplaced expression comment. New test doc-no-symbol.json shows a bad error message. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1489582656-31133-31-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2017-03-16qapi: The #optional tag is redundant, dropMarkus Armbruster5-10/+0
We traditionally mark optional members #optional in the doc comment. Before commit 3313b61, this was entirely manual. Commit 3313b61 added some automation because its qapi2texi.py relied on #optional to determine whether a member is optional. This is no longer the case since the previous commit: the only thing qapi2texi.py still does with #optional is stripping it out. We still reject bogus qapi-schema.json and six places for qga/qapi-schema.json. Thus, you can't actually rely on #optional to see whether something is optional. Yet we still make people add it manually. That's just busy-work. Drop the code to check, fix up and strip out #optional, along with all instances of #optional. To keep it out, add code to reject it, to be dropped again once the dust settles. No change to generated documentation. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-18-git-send-email-armbru@redhat.com>
2017-03-16qapi: Fix to reject empty union base gracefullyMarkus Armbruster1-10/+1
Common Python pitfall: 'assert base_members' fires on [] in addition to None. Correct to 'assert base_members is not None'. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-10-git-send-email-armbru@redhat.com>
2017-03-16tests/qapi-schema: Cover empty union baseMarkus Armbruster5-0/+21
The new test case shows off qapi.py choking on an empty union base. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-9-git-send-email-armbru@redhat.com>
2017-03-16qapi: Have each QAPI schema declare its name rule violationsMarkus Armbruster7-1/+8
qapi.py has a hardcoded white-list of type names that may violate the rule on use of upper and lower case. Add a new pragma directive 'name-case-whitelist', and use it to replace the hard-coded white-list. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1489582656-31133-7-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2017-03-16qapi: Have each QAPI schema declare its returns white-listMarkus Armbruster8-1/+18
qapi.py has a hardcoded white-list of command names that may violate the rules on permitted return types. Add a new pragma directive 'returns-whitelist', and use it to replace the hard-coded white-list. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1489582656-31133-6-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2017-03-16qapi: Back out doc comments added just to please qapi.pyMarkus Armbruster200-1074/+92
This reverts commit 3313b61's changes to tests/qapi-schema/, except for tests/qapi-schema/doc-*. We could keep some of these doc comments to serve as positive test cases. However, they don't actually add to what we get from doc comment use in actual schemas, as we we don't test output matches expectations, and don't systematically cover doc comment features. Proper positive test coverage would be nice. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1489582656-31133-4-git-send-email-armbru@redhat.com>
2017-03-16qapi: Make doc comments optional where we don't need themMarkus Armbruster21-0/+32
Since we added the documentation generator in commit 3313b61, doc comments are mandatory. That's a very good idea for a schema that needs to be documented, but has proven to be annoying for testing. Make doc comments optional again, but add a new directive { 'pragma': { 'doc-required': true } } to let a QAPI schema require them. Add test cases for the new pragma directive. While there, plug a minor hole in includ directive test coverage. Require documentation in the schemas we actually want documented: qapi-schema.json and qga/qapi-schema.json. We could probably make qapi2texi.py cope with incomplete documentation, but for now, simply make it refuse to run unless the schema has 'doc-required': true. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1489582656-31133-3-git-send-email-armbru@redhat.com> [qapi-code-gen.txt wording tweaked] Reviewed-by: Eric Blake <eblake@redhat.com>
2017-03-16makefile: merge GENERATED_HEADERS & GENERATED_SOURCES variablesDaniel P. Berrange1-1/+1
The only functional difference between the GENERATED_HEADERS and GENERATED_SOURCES variables is that 'Makefile' has a dependancy on GENERATED_HEADERS, causing generated header files to be created immediatey at the start of the build process. There is no reason why this early creation should be restricted to the .h files, and not include .c files too. Merge both of the variables into a single GENERATED_FILES variable to make it clear it is for any type of generated file. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Message-id: 20170228122901.24520-2-berrange@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2017-03-15tests: Use error_free_or_abort() where appropriateMarkus Armbruster2-6/+3
Done with this Coccinelle semantic patch: @@ expression E; @@ - g_assert(E); - error_free(E); + error_free_or_abort(&E); Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1487362554-5688-1-git-send-email-armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
2017-03-14cpus: define QEMUTimerListNotifyCB for QEMU system emulationPaolo Bonzini2-2/+2
There is no change for now, because the callback just invokes qemu_notify_event. Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2017-03-13Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into stagingPeter Maydell4-18/+2
Block layer fixes for 2.9.0-rc1 # gpg: Signature made Mon 13 Mar 2017 11:53:16 GMT # gpg: using RSA key 0x7F09B272C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74 56FE 7F09 B272 C88F 2FD6 * remotes/kevin/tags/for-upstream: commit: Implement .bdrv_refresh_filename mirror: Implement .bdrv_refresh_filename block: Refresh filename after changing backing file commit: Implement bdrv_commit_top.bdrv_co_get_block_status block: Request block status from *file for BDRV_BLOCK_RAW block: Remove check_new_perm from bdrv_replace_child() migration: Document handling of bdrv_is_allocated() errors vvfat: React to bdrv_is_allocated() errors backup: React to bdrv_is_allocated() errors block: Drop unmaintained 'archipelago' driver file-posix: Consider max_segments for BlockLimits.max_transfer backup: allow target without .bdrv_get_info Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-03-13block: Drop unmaintained 'archipelago' driverEric Blake4-18/+2
The driver has failed to build since commit da34e65, in qemu 2.6, due to a missing include of qapi/error.h for error_setg(). Since no one has complained in three releases, it is easier to remove the dead code than to keep it around, especially since it is not being built by default and therefore prone to bitrot. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
2017-03-13Merge remote-tracking branch 'remotes/famz/tags/docker-pull-request' into ↵Peter Maydell2-2/+8
staging # gpg: Signature made Fri 10 Mar 2017 07:15:38 GMT # gpg: using RSA key 0xCA35624C6A9171C6 # gpg: Good signature from "Fam Zheng <famz@redhat.com>" # gpg: WARNING: This key is not certified with sufficiently trusted signatures! # gpg: It is not certain that the signature belongs to the owner. # Primary key fingerprint: 5003 7CB7 9706 0F76 F021 AD56 CA35 624C 6A91 71C6 * remotes/famz/tags/docker-pull-request: docker/dockerfiles/debian-s390-cross: include clang tests/docker: support proxy / corporate firewall Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2017-03-10docker/dockerfiles/debian-s390-cross: include clangAlex Bennée1-2/+2
It's a silly little limitation on Shippable that is looks for clang in the container even though we won't use it. The arm/aarch64 cross builds inherit this from debian.docker but as we needed to use debian-testing for this we add it here. We also collapse the update step into one RUN line to remove and intermediate layer of the docker build. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20170306112848.659-1-alex.bennee@linaro.org> Signed-off-by: Fam Zheng <famz@redhat.com>
2017-03-07keyval: Support listsMarkus Armbruster1-0/+122
Additionally permit non-negative integers as key components. A dictionary's keys must either be all integers or none. If all keys are integers, convert the dictionary to a list. The set of keys must be [0,N]. Examples: * list.1=goner,list.0=null,list.1=eins,list.2=zwei is equivalent to JSON [ "null", "eins", "zwei" ] * a.b.c=1,a.b.0=2 is inconsistent: a.b.c clashes with a.b.0 * list.0=null,list.2=eins,list.2=zwei has a hole: list.1 is missing Similar design flaw as for objects: there is no way to denote an empty list. While interpreting "key absent" as empty list seems natural (removing a list member from the input string works when there are multiple ones, so why not when there's just one), it doesn't work: "key absent" already means "optional list absent", which isn't the same as "empty list present". Update the keyval object visitor to use this a.0 syntax in error messages rather than the usual a[0]. Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <1488317230-26248-25-git-send-email-armbru@redhat.com> [Off-by-one fix squashed in, as per Kevin's review] Reviewed-by: Kevin Wolf <kwolf@redhat.com>
2017-03-07keyval: Restrict key components to valid QAPI namesMarkus Armbruster1-0/+10
Until now, key components are separated by '.'. This leaves little room for evolving the syntax, and is incompatible with the __RFQDN_ prefix convention for downstream extensions. Since key components will be commonly used as QAPI member names by the QObject input visitor, we can just as well borrow the QAPI naming rules here: letters, digits, hyphen and period starting with a letter, with an optional __RFQDN_ prefix for downstream extensions. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <1488317230-26248-20-git-send-email-armbru@redhat.com>
2017-03-07qapi: New parse_qapi_name()Markus Armbruster1-0/+34
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <1488317230-26248-19-git-send-email-armbru@redhat.com>
2017-03-07test-qapi-util: New, covering qapi/qapi-util.cMarkus Armbruster3-0/+55
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <1488317230-26248-18-git-send-email-armbru@redhat.com>
2017-03-07test-visitor-serialization: Pass &error_abort to qobject_from_json()Markus Armbruster1-1/+1
qmp_deserialize() calls qobject_from_json() ignoring errors. It passes the result to qobject_input_visitor_new(), which asserts it's not null. Therefore, we can just as well pass &error_abort to qobject_from_json(). Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Message-Id: <1488317230-26248-16-git-send-email-armbru@redhat.com>