block: Decouple throttling from BlockDriverState

This moves the throttling related part of the BDS life cycle management
to BlockBackend. The throttling group reference is now kept even when no
medium is inserted.

With this commit, throttling isn't disabled and then re-enabled any more
during graph reconfiguration. This fixes the temporary breakage of I/O
throttling when used with live snapshots or block jobs that manipulate
the graph.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Kevin Wolf 2016-03-22 13:00:08 +01:00
parent bb9aaecaf1
commit 7ca7f0f6db
4 changed files with 23 additions and 78 deletions

View file

@ -500,9 +500,6 @@ struct BlockBackendRootState {
int open_flags;
bool read_only;
BlockdevDetectZeroesOptions detect_zeroes;
char *throttle_group;
ThrottleState *throttle_state;
};
static inline BlockDriverState *backing_bs(BlockDriverState *bs)