summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* qapi: Add some type check testsEric Blake2015-05-0561-3/+119
| | | | | | | | | | | | | | | | | | | | | Demonstrate that the qapi generator silently parses confusing types, which may cause other errors later on. Later patches will update the expected results as the generator is made stricter. Most of the new tests focus on blatant errors. But returns-whitelist is a case where we have historically allowed returning something other than a JSON object from particular commands; we have to keep that behavior to avoid breaking clients, but it would be nicer to avoid adding such commands in the future, because any return that is not an (array of) object cannot be easily extended if future qemu wants to return additional information. The QMP protocol already documents that clients should ignore unknown dictionary keys, but does not require clients to have to handle more than one type of JSON object. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
* qapi: Unify type bypass and add testsEric Blake2015-05-0513-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | For a few QMP commands, we are forced to pass an arbitrary type without tracking it properly in QAPI. Among the existing clients, this unnamed type was spelled 'dict', 'visitor', and '**'; this patch standardizes on '**', matching the documentation changes earlier in the series. Meanwhile, for the 'gen' key, we have been ignoring the value, although the schema consistently used "'no'" ('success-response' was hard-coded to checking for 'no'). But now that we can support a literal "false" in the schema, we might as well use that rather than ignoring the value or special-casing a random string. Note that these are one-way switches (use of 'gen':true is not the same as omitting 'gen'). Also, the use of '**' requires 'gen':false, but the use of 'gen':false does not mandate the use of '**'. There is no difference to the generated code. Add some tests on what we'd like to guarantee, although it will take later patches to clean up test results and actually enforce the use of a bool parameter. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
* qapi: Allow true, false and null in schema jsonFam Zheng2015-05-052-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | In the near term, we will use it for a sensible-looking 'gen':false inside command declarations, instead of the current ugly 'gen':'no'. In the long term, it will allow conversion from shorthand with defaults mentioned only in side-band documentation: 'data':{'*flag':'bool', '*string':'str'} into an explicit default value documentation, as in: 'data':{'flag':{'type':'bool', 'optional':true, 'default':true}, 'string':{'type':'str', 'optional':true, 'default':null}} We still don't parse integer values (also necessary before we can allow explicit defaults), but that can come in a later series. Update the testsuite to match an improved error message. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
* qapi: Better error messages for duplicated expressionsEric Blake2015-05-0528-40/+21
| | | | | | | | | | | | | | | | | | | | | | The previous commit demonstrated that the generator overlooked duplicate expressions: - a complex type or command reusing a built-in type name - redeclaration of a type name, whether by the same or different metatype - redeclaration of a command or event - collision of a type with implicit 'Kind' enum for a union - collision with an implicit MAX enum constant Since the c_type() function in the generator treats all names as being in the same namespace, this patch adds a global array to track all known names and their source, to prevent collisions before it can cause further problems. While valid .json files won't trigger any of these cases, we might as well be nicer to developers that make a typo while trying to add new QAPI code. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
* qapi: Add tests of redefined expressionsEric Blake2015-05-0525-0/+45
| | | | | | | | | | | | | | Demonstrate that the qapi generator doesn't deal very well with redefined expressions. At the parse level, they are silently accepted; and while the testsuite just stops at parsing, I've further tested that many of them cause generator crashes or invalid C code if they were appended to qapi-schema-test.json. A later patch will tighten things up and adjust the testsuite to match. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
* qapi: Better error messages for bad expressionsEric Blake2015-05-0523-29/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous commit demonstrated that the generator overlooked some fairly basic broken expressions: - missing metataype - metatype key has a non-string value - unknown key in relation to the metatype - conflicting metatype (this patch treats the second metatype as an unknown key of the first key visited, which is not necessarily the first key the user typed) Add check_keys to cover these situations, and update testcases to match. A couple other tests (enum-missing-data, indented-expr) had to change since the validation added here occurs so early. Conversely, changes to ident-with-escape results show that we still have problems where our handling of escape sequences differs from true JSON, which will matter down the road if we allow arbitrary default string values for optional parameters (but for now is not too bad, as we currently can avoid unicode escaping as we don't need to represent anything beyond C identifier material). While valid .json files won't trigger any of these cases, we might as well be nicer to developers that make a typo while trying to add new QAPI code. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
* qapi: Add some expr testsEric Blake2015-05-0545-3/+72
| | | | | | | | | | | | | | | | | | | Demonstrate that the qapi generator doesn't deal well with expressions that aren't up to par. Later patches will improve the expected results as the generator is made stricter. Only a few of the the added tests actually behave sanely at rejecting obvious problems or demonstrating success. Note that in some cases, we reject bad QAPI merely because our pseudo-JSON parser does not yet know how to parse numbers. This series does not address that, but when a later series adds support for numeric defaults of integer fields, the testsuite will ensure that we don't lose the error (and hopefully that the error message quality is improved). Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
* qapi: Use 'alternate' to replace anonymous unionEric Blake2015-05-0520-41/+32
| | | | | | | | | | | | | Previous patches have led up to the point where I create the new meta-type "'alternate':'Foo'". See the previous patches for documentation; I intentionally split as much work into earlier patches to minimize the size of this patch, but a lot of it is churn due to testsuite fallout after updating to the new type. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
* qapi: Rename anonymous union type in testEric Blake2015-05-055-33/+33
| | | | | | | | | | Reduce churn in the future patch that replaces anonymous unions with a new metatype 'alternate' by changing 'AnonUnion' to 'Alternate'. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
* qapi: Segregate anonymous unions into alternates in generatorEric Blake2015-05-052-2/+2
| | | | | | | | | | | | | | | | | | Special-casing 'discriminator == {}' for handling anonymous unions is getting awkward; since this particular type is not always a dictionary on the wire, it is easier to treat it as a completely different class of type, "alternate", so that if a type is listed in the union_types array, we know it is not an anonymous union. This patch just further segregates union handling, to make sure that anonymous unions are not stored in union_types, and splitting up check_union() into separate functions. A future patch will change the qapi grammar, and having the segregation already in place will make it easier to deal with the distinct meta-type. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
* qapi: Tighten checking of unionsEric Blake2015-05-0546-75/+36
| | | | | | | | | | | | | | | | | | | | Previous commits demonstrated that the generator had several flaws with less-than-perfect unions: - a simple union that listed the same branch twice (or two variant names that map to the same C enumerator, including the implicit MAX sentinel) ended up generating invalid C code - an anonymous union that listed two branches with the same qtype ended up generating invalid C code - the generator crashed on anonymous union attempts to use an array type - the generator was silently ignoring a base type for anonymous unions - the generator allowed unknown types or nested anonymous unions as a branch in an anonymous union Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
* qapi: Forbid base without discriminator in unionsEric Blake2015-05-058-71/+3
| | | | | | | | | | | | | | | | | None of the existing QMP or QGA interfaces uses a union with a base type but no discriminator; it is easier to avoid this in the generator to save room for other future extensions more likely to be useful. An earlier commit added a union-base-no-discriminator test to ensure that we eventually give a decent error message; likewise, removing UserDefUnion outright is okay, because we moved all the tests we wish to keep into the tests of the simple union UserDefNativeListUnion in the previous commit. Now is the time to actually forbid simple union with base, and remove the last vestiges from the testsuite. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
* qapi: Clean up test coverage of simple unionsEric Blake2015-05-053-70/+86
| | | | | | | | | | | | | | | The tests of UserDefNativeListUnion serve to validate code generation of simple unions without a base type, except that it did not have full coverage in the strict test. The next commits will remove tests and support for simple unions with a base type, so there is no real loss at repurposing that test here as opposed to churn of adding a new test then deleting the old one. Fix some indentation and long lines while at it. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
* qapi: Add some union testsEric Blake2015-05-0589-9/+325
| | | | | | | | | | | | | | | | | | | | | | | | | Demonstrate that the qapi generator doesn't deal well with unions that aren't up to par. Later patches will update the expected reseults as the generator is made stricter. A few tests work as planned, but most show poor or missing error messages. Of particular note, qapi-code-gen.txt documents 'base' only for flat unions, but the tests here demonstrate that we currently allow a 'base' to a simple union, although it is exercised only in the testsuite. Later patches will remove this undocumented feature, to give us more flexibility in adding other future extensions to union types. For example, one possible extension is the idea of a type-safe simple enum, where added fields tie the discriminator to a user-defined enum type rather than creating an implicit enum from the names in 'data'. But adding such safety on top of a simple enum with a base type could look ambiguous with a flat enum; besides, the documentation also mentions how any simple union can be represented by an equivalent flat union. So it will be simpler to just outlaw support for something we aren't using. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
* qapi: Better error messages for bad enumsEric Blake2015-05-0518-27/+14
| | | | | | | | | | | | | | | | | | | | | | | | | The previous commit demonstrated that the generator had several flaws with less-than-perfect enums: - an enum that listed the same string twice (or two variant strings that map to the same C enumerator) ended up generating an invalid C enum - because the generator adds a _MAX terminator to each enum, the use of an enum member 'max' can also cause this clash - if an enum omits 'data', the generator left a python stack trace rather than a graceful message - an enum that used a non-array 'data' was silently accepted by the parser - an enum that used non-string members in the 'data' member was silently accepted by the parser Add check_enum to cover these situations, and update testcases to match. While valid .json files won't trigger any of these cases, we might as well be nicer to developers that make a typo while trying to add new QAPI code. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
* qapi: Add some enum testsEric Blake2015-05-0537-1/+66
| | | | | | | | | | Demonstrate that the qapi generator doesn't deal well with enums that aren't up to par. Later patches will update the expected results as the generator is made stricter. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
* qapi: Fix generation of 'size' builtin typeEric Blake2015-05-052-2/+3
| | | | | | | | | We were missing the 'size' builtin type (which means that QAPI using [ 'size' ] would fail to compile). Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
* misc: Fix new collection of typosStefan Weil2015-04-301-2/+2
| | | | | | | | | | All of them were reported by codespell. Most typos are in comments, one is in an error message. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* qtest: Add assertion that required environment variable is setEd Maste2015-04-281-0/+1
| | | | | | | Signed-off-by: Ed Maste <emaste@freebsd.org> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 1427911244-22565-1-git-send-email-emaste@freebsd.org Signed-off-by: John Snow <jsnow@redhat.com>
* qtest/ahci: add flush retry testJohn Snow2015-04-281-0/+44
| | | | | Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1426018503-821-7-git-send-email-jsnow@redhat.com
* libqos: add blkdebug_prepare_scriptJohn Snow2015-04-283-22/+24
| | | | | | | | Pull this helper out of ide-test and into libqos, to be shared with ahci-test. Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1426018503-821-6-git-send-email-jsnow@redhat.com
* libqtest: add qmp_asyncJohn Snow2015-04-282-1/+56
| | | | | | | | | | | | | Add qmp_async, which lets us send QMP commands asynchronously. This is useful when we want to send commands that will trigger event responses, but we don't know in what order to expect them. Sometimes the event responses may arrive even before the command confirmation will show up, so it is convenient to leave the responses in the stream. Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1426018503-821-5-git-send-email-jsnow@redhat.com
* libqtest: add qmp_eventwaitJohn Snow2015-04-283-10/+37
| | | | | | | Allow the user to poll until a desired interrupt occurs. Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1426018503-821-4-git-send-email-jsnow@redhat.com
* qtest/ahci: Allow override of default CLI optionsJohn Snow2015-04-283-22/+51
| | | | | Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1426018503-821-3-git-send-email-jsnow@redhat.com
* qtest/ahci: Add simple flush testJohn Snow2015-04-281-0/+34
| | | | | Signed-off-by: John Snow <jsnow@redhat.com> Message-id: 1426018503-821-2-git-send-email-jsnow@redhat.com
* qtest/ahci: test different disk sectorsJohn Snow2015-04-283-19/+63
| | | | | | | | | Test sector offset 0, 1, and the last sector(s) in LBA28 and LBA48 modes. Signed-off-by: John Snow <jsnow@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1426274523-22661-3-git-send-email-jsnow@redhat.com
* qtest/ahci: add qcow2 support to ahci-testJohn Snow2015-04-284-10/+53
| | | | | | | | | | | | This will enable the testing of high offsets without wasting a lot of disk space, and does not impact the previous tests. mkimg and mkqcow2 are added to libqos for other tests. Signed-off-by: John Snow <jsnow@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1426274523-22661-2-git-send-email-jsnow@redhat.com
* iotests: add incremental backup granularity testsJohn Snow2015-04-282-13/+49
| | | | | | | | | | | Test what happens if you fiddle with the granularity. Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1429314609-29776-22-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: add incremental backup failure recovery testJohn Snow2015-04-282-2/+59
| | | | | | | | | | | Test the failure case for incremental backups. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1429314609-29776-21-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: add simple incremental backup caseJohn Snow2015-04-282-6/+172
| | | | | | | | | Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1429314609-29776-20-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: add QMP event waiting queueJohn Snow2015-04-281-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | A filter is added to allow callers to request very specific events to be pulled from the event queue, while leaving undesired events still in the stream. This allows us to poll for completion data for multiple asynchronous events in any arbitrary order. A new timeout context is added to the qmp pull_event method's wait parameter to allow tests to fail if they do not complete within some expected period of time. Also fixed is a bug in qmp.pull_event where we try to retrieve an event from an empty list if we attempt to retrieve an event with wait=False but no events have occurred. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1429314609-29776-19-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* iotests: add invalid input incremental backup testsJohn Snow2015-04-283-0/+110
| | | | | | | | | Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1429314609-29776-18-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* hbitmap: truncate testsJohn Snow2015-04-281-0/+255
| | | | | | | | | | | | | | | | | | | | The general approach is to set bits close to the boundaries of where we are truncating and ensure that everything appears to have gone OK. We test growing and shrinking by different amounts: - Less than the granularity - Less than the granularity, but across a boundary - Less than sizeof(unsigned long) - Less than sizeof(unsigned long), but across a ulong boundary - More than sizeof(unsigned long) Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1429314609-29776-17-git-send-email-jsnow@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: Test that "stop" doesn't drain block jobsFam Zheng2015-04-283-0/+92
| | | | | | | | | | Signed-off-by: Fam Zheng <famz@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Message-id: 1428069921-2957-4-git-send-email-famz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qemu-iotests: Some qemu-img convert testsKevin Wolf2015-04-283-0/+433
| | | | | | | | This adds a regression test for some problems that the qemu-img convert rewrite just fixed. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com>
* iothread: release iothread around aio_pollPaolo Bonzini2015-04-281-8/+11
| | | | | | | | | | | | | | | | This is the first step towards having fine-grained critical sections in dataplane threads, which resolves lock ordering problems between address_space_* functions (which need the BQL when doing MMIO, even after we complete RCU-based dispatch) and the AioContext. Because AioContext does not use contention callbacks anymore, the unit test has to be changed. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1424449612-18215-4-git-send-email-pbonzini@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* qcow2: Fix header update with overridden backing fileKevin Wolf2015-04-083-0/+139
| | | | | | | | | | | | | | | | | In recent qemu versions, it is possible to override the backing file name and format that is stored in the image file with values given at runtime. In such cases, the temporary override could end up in the image header if the qcow2 header was updated, while obviously correct behaviour would be to leave the on-disk backing file path/format unchanged. Fix this and add a test case for it. Reported-by: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-id: 1428411796-2852-1-git-send-email-kwolf@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* i440fx-test: Fix test paths to include architectureAndreas Färber2015-03-301-6/+6
| | | | | | | | | | | Replace g_test_add_func() with new qtest_add_func() and g_test_add() macro with qtest_add() macro. This effectively changes GTester paths: /i440fx/foo -> /x86_64/i440fx/foo etc. Cc: qemu-stable@nongnu.org Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* qtest: Add qtest_add() wrapper macroAndreas Färber2015-03-301-0/+20
| | | | | | | It extends g_test_add() macro with the architecture path. Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* qtest: Add qtest_add_data_func() wrapper functionAndreas Färber2015-03-302-0/+19
| | | | | | | | | It calls g_test_add_data_func() with a path supplemented by the architecture, like qtest_add_func() does. Reviewed-by: John Snow <jsnow@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* fw_cfg-test: Fix test path to include architectureAndreas Färber2015-03-301-13/+13
| | | | | | | | | | | Use qtest_add_func() instead of g_test_add_func() to reflect the architecture tested, changing GTester paths as follows: /fw_cfg/foo -> /x86_64/fw_cfg/foo etc. Cc: qemu-stable@nongnu.org Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* qemu-iotests: Test unaligned 4k zero writeFam Zheng2015-03-272-17/+56
| | | | | | Signed-off-by: Fam Zheng <famz@redhat.com> Message-id: 1427160230-4489-3-git-send-email-famz@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
* misc: fix typos in copyright declarationGonglei2015-03-263-3/+3
| | | | | | | | | Add a space after comma. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Message-Id: <1427374663-10168-1-git-send-email-arei.gonglei@huawei.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* rcu tests: fix compilation on 32-bit ppcPaolo Bonzini2015-03-252-26/+44
| | | | | | | | | | | | | | | | | 32-bit PPC cannot do atomic operations on long long. Inside the loops, we are already using local counters that are summed at the end of the run---with some exceptions (rcu_stress_count for rcutorture, n_nodes for test-rcu-list): fix them to use the same technique. For test-rcu-list, remove the mostly unused member "val" from the list. Then, use a mutex to protect the global counts. Performance does not matter there because every thread will only enter the critical section once. Remaining uses of atomic instructions are for ints or pointers. Reported-by: Andreas Faerber <afaerber@suse.de> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* ahci-test: improve rw buffer patternsJohn Snow2015-03-231-8/+28
| | | | | | | | | | | | My pattern was cyclical every 256 bytes, so it missed a fairly obvious failure case. Add some rand() pepper into the test pattern, and for large patterns that exceed 256 sectors, start writing an ID per-sector so that we never generate identical sector patterns. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Tested-by: Andreas Färber <afaerber@suse.de> Message-id: 1426811056-2202-5-git-send-email-jsnow@redhat.com
* Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into stagingPeter Maydell2015-03-191-4/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Block patches for 2.3.0-rc1 # gpg: Signature made Thu Mar 19 15:03:26 2015 GMT using RSA key ID C88F2FD6 # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" * remotes/kevin/tags/for-upstream: block: Fix blockdev-backup not to use funky error class raw-posix: Deprecate aio=threads fallback without O_DIRECT raw-posix: Deprecate host floppy passthrough Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
| * block: Fix blockdev-backup not to use funky error classMarkus Armbruster2015-03-191-4/+7
| | | | | | | | | | | | | | | | | | | | | | Error classes are a leftover from the days of "rich" error objects. New code should always use ERROR_CLASS_GENERIC_ERROR. Commit b7b9d39..7c6a4ab added uses of ERROR_CLASS_DEVICE_NOT_FOUND. Replace them. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* | qtest/ahci: Fix a bit mask expressionJohn Snow2015-03-191-1/+1
|/ | | | | | | | | A thinko that clang 3.5.0 caught. Thankfully does not introduce any new failures. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* tests: Add PC CPU testAndreas Färber2015-03-172-0/+149
| | | | | | | | | | | | Test non-default -smp core and thread counts and a non-default CPU model on all PC machines except for isapc. Note that not all historic versions actually supported this particular configuration, ignored for simplicity. For machines pc-*-1.5+ test QMP cpu-add with monotonically increasing ID, and test for graceful failure otherwise. Cc: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
* iotests: Test non-self-referential qcow2 refblocksMax Reitz2015-03-163-0/+104
| | | | | | | | | | | | It is easy to create only self-referential refblocks, but there are cases where that is impossible. This adds a test for two of those cases (combined in a single test case). Suggested-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 1417798412-15330-1-git-send-email-mreitz@redhat.com Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Max Reitz <mreitz@redhat.com>
OpenPOWER on IntegriCloud