summaryrefslogtreecommitdiffstats
path: root/tests/test-throttle.c
Commit message (Collapse)AuthorAgeFilesLines
* tests: Add missing 'static' attributes (fix warnings from smatch)Stefan Weil2014-07-181-4/+4
| | | | | | | | Smatch also complains about 0 used for pointers, so replace those by NULL in test-visitor-serialization.c, too. Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* throttle: add detach/attach test caseStefan Hajnoczi2014-06-041-0/+24
| | | | | | | | Add a test case that checks the timer is really removed/added by the detach/attach functions. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net>
* throttle: add throttle_detach/attach_aio_context()Stefan Hajnoczi2014-06-041-5/+20
| | | | | | | | | | | | | | | | | Block I/O throttling uses timers and currently always adds them to the main loop. Throttling will break if bdrv_set_aio_context() is used to move a BlockDriverState to a different AioContext. This patch adds throttle_detach/attach_aio_context() interfaces so the throttling timers and uses them to move timers to the new AioContext. Note that bdrv_set_aio_context() already drains all requests so we're sure no throttled requests are pending. The test cases need to be updated since the throttle_init() interface has changed. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net>
* misc: New spelling fixes in commentsStefan Weil2013-10-261-2/+2
| | | | | | | | | | | compatiblity -> compatibility continously -> continuously existance -> existence usefull -> useful shoudl -> should Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* throttle: Add units testsBenoƮt Canet2013-09-061-0/+481
Signed-off-by: Benoit Canet <benoit@irqsave.net> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>