summaryrefslogtreecommitdiff
path: root/block/block-backend.c
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2016-03-08 13:47:49 +0100
committerKevin Wolf <kwolf@redhat.com>2016-03-17 15:47:57 +0100
commit5bd51196676b07d3f9ddb3086057b0d82ae95f36 (patch)
tree389847d00f4d8d0c770c148ba485d7e35d10c7e8 /block/block-backend.c
parenta8823a3bfd8a8adfa11dea61b151175a02caa7d0 (diff)
downloadqemu-5bd51196676b07d3f9ddb3086057b0d82ae95f36.tar.gz
block: Pull up blk_read_unthrottled() implementation
Use blk_read(), so that it goes through blk_co_preadv() like all read requests from the BB to the BDS. Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/block-backend.c')
-rw-r--r--block/block-backend.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/block/block-backend.c b/block/block-backend.c
index 5b15475c13..475d27a4da 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -789,12 +789,20 @@ int blk_read(BlockBackend *blk, int64_t sector_num, uint8_t *buf,
int blk_read_unthrottled(BlockBackend *blk, int64_t sector_num, uint8_t *buf,
int nb_sectors)
{
- int ret = blk_check_request(blk, sector_num, nb_sectors);
+ BlockDriverState *bs = blk_bs(blk);
+ bool enabled;
+ int ret;
+
+ ret = blk_check_request(blk, sector_num, nb_sectors);
if (ret < 0) {
return ret;
}
- return bdrv_read_unthrottled(blk_bs(blk), sector_num, buf, nb_sectors);
+ enabled = bs->io_limits_enabled;
+ bs->io_limits_enabled = false;
+ ret = blk_read(blk, sector_num, buf, nb_sectors);
+ bs->io_limits_enabled = enabled;
+ return ret;
}
int blk_write(BlockBackend *blk, int64_t sector_num, const uint8_t *buf,