mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
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>
This commit is contained in:
parent
b6e84c97ed
commit
ce0f141259
5 changed files with 33 additions and 20 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue