throttle: Check for pending requests in throttle_group_unregister_bs()
commit5ac724184c286b367525035eabf4b8bb4a386c54
authorAlberto Garcia <berto@igalia.com>
Wed, 4 Nov 2015 13:15:35 +0000 (4 15:15 +0200)
committerKevin Wolf <kwolf@redhat.com>
Wed, 11 Nov 2015 15:25:47 +0000 (11 16:25 +0100)
tree0d57e21604578d35bf7c64574450b8cace77115c
parent62547b8a1c04daf30f50e3db362ade53e22bf222
throttle: Check for pending requests in throttle_group_unregister_bs()

throttle_group_unregister_bs() removes a BlockDriverState from its
throttling group and destroys the timers. This means that there must
be no pending throttled requests at that point (because it would be
impossible to complete them), so the caller has to drain them first.

At the moment throttle_group_unregister_bs() is only called from
bdrv_io_limits_disable(), which already takes care of draining the
requests, so there's nothing to worry about, but this patch makes
this invariant explicit in the documentation and adds the relevant
assertions.

Signed-off-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/throttle-groups.c