aboutsummaryrefslogtreecommitdiff
path: root/include/sysemu/block-backend.h
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2016-03-21 12:56:44 +0100
committerKevin Wolf <kwolf@redhat.com>2016-05-19 16:45:30 +0200
commit27ccdd52598290f0f8b58be56e235aff7aebfaf3 (patch)
tree3eae4aa48f08ad96ad0a9461ea52cf1ef160d0fc /include/sysemu/block-backend.h
parent49d2165d7d6b589d1ea28b15a8874c417bdc55ed (diff)
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>
Diffstat (limited to 'include/sysemu/block-backend.h')
-rw-r--r--include/sysemu/block-backend.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h
index 1dcd70e2ca..08d27a86be 100644
--- a/include/sysemu/block-backend.h
+++ b/include/sysemu/block-backend.h
@@ -14,6 +14,7 @@
#define BLOCK_BACKEND_H
#include "qemu/iov.h"
+#include "block/throttle-groups.h"
/*
* TODO Have to include block/block.h for a bunch of block layer
@@ -63,9 +64,17 @@ typedef struct BlockDevOps {
* fields that must be public. This is in particular for QLIST_ENTRY() and
* friends so that BlockBackends can be kept in lists outside block-backend.c */
typedef struct BlockBackendPublic {
- /* I/O throttling */
+ /* I/O throttling.
+ * throttle_state tells us if this BlockBackend 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];
QLIST_ENTRY(BlockBackendPublic) round_robin;
} BlockBackendPublic;