[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 30/69] block: Switch blk_read_unthrottled() to byte i
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 30/69] block: Switch blk_read_unthrottled() to byte interface |
Date: |
Thu, 12 May 2016 16:35:10 +0200 |
From: Eric Blake <address@hidden>
Sector-based blk_read() should die; convert the one-off
variant blk_read_unthrottled().
Signed-off-by: Eric Blake <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
block/block-backend.c | 8 ++++----
hw/block/hd-geometry.c | 2 +-
include/sysemu/block-backend.h | 4 ++--
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/block/block-backend.c b/block/block-backend.c
index 96c1d7c..e5a8a07 100644
--- a/block/block-backend.c
+++ b/block/block-backend.c
@@ -790,19 +790,19 @@ int blk_read(BlockBackend *blk, int64_t sector_num,
uint8_t *buf,
return blk_rw(blk, sector_num, buf, nb_sectors, blk_read_entry, 0);
}
-int blk_read_unthrottled(BlockBackend *blk, int64_t sector_num, uint8_t *buf,
- int nb_sectors)
+int blk_pread_unthrottled(BlockBackend *blk, int64_t offset, uint8_t *buf,
+ int count)
{
BlockDriverState *bs = blk_bs(blk);
int ret;
- ret = blk_check_request(blk, sector_num, nb_sectors);
+ ret = blk_check_byte_request(blk, offset, count);
if (ret < 0) {
return ret;
}
bdrv_no_throttling_begin(bs);
- ret = blk_read(blk, sector_num, buf, nb_sectors);
+ ret = blk_pread(blk, offset, buf, count);
bdrv_no_throttling_end(bs);
return ret;
}
diff --git a/hw/block/hd-geometry.c b/hw/block/hd-geometry.c
index 6d02192..d388f13 100644
--- a/hw/block/hd-geometry.c
+++ b/hw/block/hd-geometry.c
@@ -66,7 +66,7 @@ static int guess_disk_lchs(BlockBackend *blk,
* but also in async I/O mode. So the I/O throttling function has to
* be disabled temporarily here, not permanently.
*/
- if (blk_read_unthrottled(blk, 0, buf, 1) < 0) {
+ if (blk_pread_unthrottled(blk, 0, buf, BDRV_SECTOR_SIZE) < 0) {
return -1;
}
/* test msdos magic */
diff --git a/include/sysemu/block-backend.h b/include/sysemu/block-backend.h
index 6991b26..662a106 100644
--- a/include/sysemu/block-backend.h
+++ b/include/sysemu/block-backend.h
@@ -92,8 +92,8 @@ void *blk_get_attached_dev(BlockBackend *blk);
void blk_set_dev_ops(BlockBackend *blk, const BlockDevOps *ops, void *opaque);
int blk_read(BlockBackend *blk, int64_t sector_num, uint8_t *buf,
int nb_sectors);
-int blk_read_unthrottled(BlockBackend *blk, int64_t sector_num, uint8_t *buf,
- int nb_sectors);
+int blk_pread_unthrottled(BlockBackend *blk, int64_t offset, uint8_t *buf,
+ int count);
int blk_write(BlockBackend *blk, int64_t sector_num, const uint8_t *buf,
int nb_sectors);
int blk_write_zeroes(BlockBackend *blk, int64_t sector_num,
--
1.8.3.1
- [Qemu-devel] [PULL 14/69] cloop: Implement .bdrv_co_preadv() interface, (continued)
- [Qemu-devel] [PULL 14/69] cloop: Implement .bdrv_co_preadv() interface, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 18/69] vmdk: Add vmdk_find_offset_in_cluster(), Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 26/69] block: always compile-check debug prints, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 19/69] vmdk: Implement .bdrv_co_preadv() interface, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 22/69] vpc: Implement .bdrv_co_pwritev() interface, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 25/69] block: Fix typo in comment, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 27/69] Allow users to specify the vmdk virtual hardware version., Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 29/69] block: Allow BDRV_REQ_FUA through blk_pwrite(), Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 28/69] qemu-io: Fix memory leak in 'aio_write -z', Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 44/69] nbd: Switch to byte-based block access, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 30/69] block: Switch blk_read_unthrottled() to byte interface,
Kevin Wolf <=
- [Qemu-devel] [PULL 39/69] onenand: Switch to byte-based block access, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 37/69] fdc: Switch to byte-based block access, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 23/69] vvfat: Implement .bdrv_co_preadv/pwritev interfaces, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 31/69] block: Switch blk_*write_zeroes() to byte interface, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 47/69] block: Kill unused sector-based blk_* functions, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 46/69] qemu-io: Switch to byte-based block access, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 34/69] scsi-disk: Switch to byte-based aio block access, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 32/69] block: Introduce byte-based aio read/write, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 51/69] nbd: Simplify client FUA handling, Kevin Wolf, 2016/05/12
- [Qemu-devel] [PULL 48/69] qcow2: improve qcow2_co_write_zeroes(), Kevin Wolf, 2016/05/12