summaryrefslogtreecommitdiffstats
path: root/tests/test-bdrv-drain.c
Commit message (Collapse)AuthorAgeFilesLines
...
* blockjobs: model single jobs as transactionsJohn Snow2018-03-191-2/+2
| | | | | | | | | | | | | | | model all independent jobs as single job transactions. It's one less case we have to worry about when we add more states to the transition machine. This way, we can just treat all job lifetimes exactly the same. This helps tighten assertions of the STM graph and removes some conditionals that would have been needed in the coming commits adding a more explicit job lifetime management API. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* test-bdrv-drain: Test graph changes in drained sectionKevin Wolf2017-12-221-0/+80
| | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* test-bdrv-drain: Recursive draining with multiple parentsKevin Wolf2017-12-221-0/+74
| | | | | | Test that drain sections are correctly propagated through the graph. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* test-bdrv-drain: Test behaviour in coroutine contextKevin Wolf2017-12-221-0/+59
| | | | | | | | If bdrv_do_drained_begin/end() are called in coroutine context, they first use a BH to get out of the coroutine context. Call some existing tests again from a coroutine to cover this code path. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* test-bdrv-drain: Tests for bdrv_subtree_drainKevin Wolf2017-12-221-1/+26
| | | | | | Add a subtree drain version to the existing test cases. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* test-bdrv-drain: Test nested drain sectionsKevin Wolf2017-12-221-0/+57
| | | | Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* block: Don't block_job_pause_all() in bdrv_drain_all()Kevin Wolf2017-12-221-6/+4Star
| | | | | | | Block jobs are already paused using the BdrvChildRole drain callbacks, so we don't need an additional block_job_pause_all() call. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* test-bdrv-drain: Test drain vs. block jobsKevin Wolf2017-12-221-0/+121
| | | | | | Block jobs must be paused if any of the involved nodes are drained. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* test-bdrv-drain: Test bs->quiesce_counterKevin Wolf2017-12-221-0/+45
| | | | | | | | This is currently only working correctly for bdrv_drain(), not for bdrv_drain_all(). Leave a comment for the drain_all case, we'll address it later. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* test-bdrv-drain: Test callback for bdrv_drainKevin Wolf2017-12-221-7/+62
| | | | | | | | | | | | The existing test is for bdrv_drain_all_begin/end() only. Generalise the test case so that it can be run for the other variants as well. At the moment this is only bdrv_drain_begin/end(), but in a while, we'll add another one. Also, add a backing file to the test node to test whether the operations work recursively. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
* test-bdrv-drain: Test BlockDriver callbacks for drainKevin Wolf2017-12-221-0/+137
This adds a test case that the BlockDriver callbacks for drain are called in bdrv_drained_all_begin/end(), and that both of them are called exactly once. Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>