diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2016-04-07 18:33:33 +0200 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2016-05-12 15:22:07 +0200 |
commit | ce0f141259f06fd77fde2519cc352618ad797ce2 (patch) | |
tree | 204c5d21527ea538dddc7cdda5c239cf6a08c5e9 /block/block-backend.c | |
parent | b6e84c97ed0d786a7cda4e184736e25bb8824c2c (diff) | |
download | qemu-ce0f141259f06fd77fde2519cc352618ad797ce2.zip |
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 'block/block-backend.c')
-rw-r--r-- | block/block-backend.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/block/block-backend.c b/block/block-backend.c index 16c9d5e0f2..9538e79641 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -794,7 +794,6 @@ int blk_read_unthrottled(BlockBackend *blk, int64_t sector_num, uint8_t *buf, int nb_sectors) { BlockDriverState *bs = blk_bs(blk); - bool enabled; int ret; ret = blk_check_request(blk, sector_num, nb_sectors); @@ -802,10 +801,9 @@ int blk_read_unthrottled(BlockBackend *blk, int64_t sector_num, uint8_t *buf, return ret; } - enabled = bs->io_limits_enabled; - bs->io_limits_enabled = false; + bdrv_no_throttling_begin(bs); ret = blk_read(blk, sector_num, buf, nb_sectors); - bs->io_limits_enabled = enabled; + bdrv_no_throttling_end(bs); return ret; } |