block: Move throttling fields from BDS to BB

This patch changes where the throttling state is stored (used to be the
BlockDriverState, now it is the BlockBackend), but it doesn't actually
make it a BB level feature yet. For example, throttling is still
disabled when the BDS is detached from the BB.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Kevin Wolf 2016-03-21 12:56:44 +01:00
parent 49d2165d7d
commit 27ccdd5259
10 changed files with 142 additions and 118 deletions

View file

@ -26,7 +26,6 @@
#include "block/accounting.h"
#include "block/block.h"
#include "block/throttle-groups.h"
#include "qemu/option.h"
#include "qemu/queue.h"
#include "qemu/coroutine.h"
@ -424,18 +423,6 @@ struct BlockDriverState {
/* number of in-flight serialising requests */
unsigned int serialising_in_flight;
/* I/O throttling.
* throttle_state tells us if this BDS has I/O limits configured.
* io_limits_disabled tells us if they are currently being enforced */
CoQueue throttled_reqs[2];
unsigned int io_limits_disabled;
/* The following fields are protected by the ThrottleGroup lock.
* See the ThrottleGroup documentation for details. */
ThrottleState *throttle_state;
ThrottleTimers throttle_timers;
unsigned pending_reqs[2];
/* Offset after the highest byte written to */
uint64_t wr_highest_offset;