diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2016-07-21 11:00:36 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-07-21 11:00:36 +0100 |
commit | 61ead113ae53a4dae63b5377ace1300cb8705682 (patch) | |
tree | 7bce8156491303346fd6ff82504f074b71b8cb84 /block/raw-win32.c | |
parent | b95aae121b966ef6cd0781a6610c6902b272c542 (diff) | |
parent | decaeed7734bddc95e2c81858fbbec3e923310a1 (diff) |
Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging
Pull request
v2:
* Resolved merge conflict with block/iscsi.c [Peter]
# gpg: Signature made Wed 20 Jul 2016 17:20:52 BST
# gpg: using RSA key 0x9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
# gpg: aka "Stefan Hajnoczi <stefanha@gmail.com>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35 775A 9CA4 ABB3 81AB 73C8
* remotes/stefanha/tags/block-pull-request: (25 commits)
raw_bsd: Convert to byte-based interface
nbd: Convert to byte-based interface
block: Kill .bdrv_co_discard()
sheepdog: Switch .bdrv_co_discard() to byte-based
raw_bsd: Switch .bdrv_co_discard() to byte-based
qcow2: Switch .bdrv_co_discard() to byte-based
nbd: Switch .bdrv_co_discard() to byte-based
iscsi: Switch .bdrv_co_discard() to byte-based
gluster: Switch .bdrv_co_discard() to byte-based
blkreplay: Switch .bdrv_co_discard() to byte-based
block: Add .bdrv_co_pdiscard() driver callback
block: Convert .bdrv_aio_discard() to byte-based
rbd: Switch rbd_start_aio() to byte-based
raw-posix: Switch paio_submit() to byte-based
block: Convert BB interface to byte-based discards
block: Convert bdrv_aio_discard() to byte-based
block: Switch BlockRequest to byte-based
block: Convert bdrv_discard() to byte-based
block: Convert bdrv_co_discard() to byte-based
iscsi: Rely on block layer to break up large requests
...
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Conflicts:
block/gluster.c
Diffstat (limited to 'block/raw-win32.c')
-rw-r--r-- | block/raw-win32.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/block/raw-win32.c b/block/raw-win32.c index 9b813d99ae..56f45fea9e 100644 --- a/block/raw-win32.c +++ b/block/raw-win32.c @@ -142,7 +142,7 @@ static int aio_worker(void *arg) } static BlockAIOCB *paio_submit(BlockDriverState *bs, HANDLE hfile, - int64_t sector_num, QEMUIOVector *qiov, int nb_sectors, + int64_t offset, QEMUIOVector *qiov, int count, BlockCompletionFunc *cb, void *opaque, int type) { RawWin32AIOData *acb = g_new(RawWin32AIOData, 1); @@ -155,11 +155,12 @@ static BlockAIOCB *paio_submit(BlockDriverState *bs, HANDLE hfile, if (qiov) { acb->aio_iov = qiov->iov; acb->aio_niov = qiov->niov; + assert(qiov->size == count); } - acb->aio_nbytes = nb_sectors * 512; - acb->aio_offset = sector_num * 512; + acb->aio_nbytes = count; + acb->aio_offset = offset; - trace_paio_submit(acb, opaque, sector_num, nb_sectors, type); + trace_paio_submit(acb, opaque, offset, count, type); pool = aio_get_thread_pool(bdrv_get_aio_context(bs)); return thread_pool_submit_aio(pool, aio_worker, acb, cb, opaque); } @@ -378,9 +379,10 @@ static BlockAIOCB *raw_aio_readv(BlockDriverState *bs, BDRVRawState *s = bs->opaque; if (s->aio) { return win32_aio_submit(bs, s->aio, s->hfile, sector_num, qiov, - nb_sectors, cb, opaque, QEMU_AIO_READ); + nb_sectors, cb, opaque, QEMU_AIO_READ); } else { - return paio_submit(bs, s->hfile, sector_num, qiov, nb_sectors, + return paio_submit(bs, s->hfile, sector_num << BDRV_SECTOR_BITS, qiov, + nb_sectors << BDRV_SECTOR_BITS, cb, opaque, QEMU_AIO_READ); } } @@ -392,9 +394,10 @@ static BlockAIOCB *raw_aio_writev(BlockDriverState *bs, BDRVRawState *s = bs->opaque; if (s->aio) { return win32_aio_submit(bs, s->aio, s->hfile, sector_num, qiov, - nb_sectors, cb, opaque, QEMU_AIO_WRITE); + nb_sectors, cb, opaque, QEMU_AIO_WRITE); } else { - return paio_submit(bs, s->hfile, sector_num, qiov, nb_sectors, + return paio_submit(bs, s->hfile, sector_num << BDRV_SECTOR_BITS, qiov, + nb_sectors << BDRV_SECTOR_BITS, cb, opaque, QEMU_AIO_WRITE); } } |