From de7056a3f95e85aa6bba30ad4b37a8dbc2b072ab Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 24 Apr 2018 14:25:02 -0500 Subject: file-win32: Switch to byte-based callbacks We are gradually moving away from sector-based interfaces, towards byte-based. Make the change for the last few sector-based callbacks in the file-win32 driver. Note that the driver was already using byte-based calls for performing actual I/O, so this just gets rid of a round trip of scaling; however, as I don't know if Windows is tolerant of non-sector AIO operations, I went with the conservative approach of modifying .bdrv_refresh_limits to override the block layer defaults back to the pre-patch value of 512. Signed-off-by: Eric Blake Signed-off-by: Kevin Wolf --- block/win32-aio.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'block/win32-aio.c') diff --git a/block/win32-aio.c b/block/win32-aio.c index 3be8f45..9cd355d 100644 --- a/block/win32-aio.c +++ b/block/win32-aio.c @@ -112,15 +112,14 @@ static const AIOCBInfo win32_aiocb_info = { BlockAIOCB *win32_aio_submit(BlockDriverState *bs, QEMUWin32AIOState *aio, HANDLE hfile, - int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, + uint64_t offset, uint64_t bytes, QEMUIOVector *qiov, BlockCompletionFunc *cb, void *opaque, int type) { struct QEMUWin32AIOCB *waiocb; - uint64_t offset = sector_num * 512; DWORD rc; waiocb = qemu_aio_get(&win32_aiocb_info, bs, cb, opaque); - waiocb->nbytes = nb_sectors * 512; + waiocb->nbytes = bytes; waiocb->qiov = qiov; waiocb->is_read = (type == QEMU_AIO_READ); -- cgit v1.1