aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-04-07 18:33:33 +0200
committerKevin Wolf <kwolf@redhat.com>2016-05-12 15:22:07 +0200
commitce0f141259f06fd77fde2519cc352618ad797ce2 (patch)
tree204c5d21527ea538dddc7cdda5c239cf6a08c5e9 /include
parentb6e84c97ed0d786a7cda4e184736e25bb8824c2c (diff)
block: introduce bdrv_no_throttling_begin/end
Extract the handling of throttling from bdrv_flush_io_queue. These new functions will soon become BdrvChildRole callbacks, as they can be generalized to "beginning of drain" and "end of drain". Reviewed-by: Alberto Garcia <berto@igalia.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/block/block_int.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 10d87595be..ed9314b615 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -424,10 +424,10 @@ struct BlockDriverState {
/* I/O throttling.
* throttle_state tells us if this BDS has I/O limits configured.
- * io_limits_enabled tells us if they are currently being
- * enforced, but it can be temporarily set to false */
+ * io_limits_disabled tells us if they are currently being enforced */
CoQueue throttled_reqs[2];
- bool io_limits_enabled;
+ unsigned int io_limits_disabled;
+
/* The following fields are protected by the ThrottleGroup lock.
* See the ThrottleGroup documentation for details. */
ThrottleState *throttle_state;
@@ -713,6 +713,9 @@ BdrvChild *bdrv_root_attach_child(BlockDriverState *child_bs,
const BdrvChildRole *child_role);
void bdrv_root_unref_child(BdrvChild *child);
+void bdrv_no_throttling_begin(BlockDriverState *bs);
+void bdrv_no_throttling_end(BlockDriverState *bs);
+
void blk_dev_change_media_cb(BlockBackend *blk, bool load);
bool blk_dev_has_removable_media(BlockBackend *blk);
bool blk_dev_has_tray(BlockBackend *blk);