]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commit
throttle: add throttle_detach/attach_aio_context()
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 14 May 2014 14:22:45 +0000 (16:22 +0200)
committerStefan Hajnoczi <stefanha@redhat.com>
Wed, 4 Jun 2014 07:56:12 +0000 (09:56 +0200)
commit13af91ebf08d463d3b025cd396d4d11caceac02d
treee8cceb2eed58426150d866fb10c8af31a3f715bc
parentc9f87b20b996b1005b646281195d61412ba2b844
throttle: add throttle_detach/attach_aio_context()

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>
block.c
include/qemu/throttle.h
tests/test-throttle.c
util/throttle.c