diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-03-12 19:57:16 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-03-12 19:57:16 +0000 |
commit | eda578e559879b1a6a85f924adf2942070ae7ec3 (patch) | |
tree | e2ed165dddbda7b7a1a543185ed4b86daa5a501f /block-raw-win32.c | |
parent | 04eeb8b6d68ed314746856c813ce6fa8bc1a95df (diff) |
Drop internal bdrv_pread()/bdrv_pwrite() APIs (Avi Kivity)
Now that scsi generic no longer uses bdrv_pread() and bdrv_pwrite(), we can
drop the corresponding internal APIs, which overlap bdrv_read()/bdrv_write()
and, being byte oriented, are unnatural for a block device.
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6824 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'block-raw-win32.c')
-rw-r--r-- | block-raw-win32.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/block-raw-win32.c b/block-raw-win32.c index 6387b09593..8564a72762 100644 --- a/block-raw-win32.c +++ b/block-raw-win32.c @@ -122,13 +122,15 @@ static int raw_open(BlockDriverState *bs, const char *filename, int flags) return 0; } -static int raw_pread(BlockDriverState *bs, int64_t offset, - uint8_t *buf, int count) +static int raw_read(BlockDriverState *bs, int64_t sector_num, + uint8_t *buf, int nb_sectors) { BDRVRawState *s = bs->opaque; OVERLAPPED ov; DWORD ret_count; int ret; + int64_t offset = sector_num * 512; + int count = nb_sectors * 512; memset(&ov, 0, sizeof(ov)); ov.Offset = offset; @@ -146,13 +148,15 @@ static int raw_pread(BlockDriverState *bs, int64_t offset, return ret_count; } -static int raw_pwrite(BlockDriverState *bs, int64_t offset, - const uint8_t *buf, int count) +static int raw_write(BlockDriverState *bs, int64_t sector_num, + const uint8_t *buf, int nb_sectors) { BDRVRawState *s = bs->opaque; OVERLAPPED ov; DWORD ret_count; int ret; + int64_t offset = sector_num * 512; + int count = nb_sectors * 512; memset(&ov, 0, sizeof(ov)); ov.Offset = offset; @@ -359,8 +363,8 @@ BlockDriver bdrv_raw = { .bdrv_aio_cancel = raw_aio_cancel, .aiocb_size = sizeof(RawAIOCB); #endif - .bdrv_pread = raw_pread, - .bdrv_pwrite = raw_pwrite, + .bdrv_read = raw_read, + .bdrv_write = raw_write, .bdrv_truncate = raw_truncate, .bdrv_getlength = raw_getlength, }; @@ -508,7 +512,7 @@ BlockDriver bdrv_host_device = { .bdrv_aio_cancel = raw_aio_cancel, .aiocb_size = sizeof(RawAIOCB); #endif - .bdrv_pread = raw_pread, - .bdrv_pwrite = raw_pwrite, + .bdrv_read = raw_read, + .bdrv_write = raw_write, .bdrv_getlength = raw_getlength, }; |