aboutsummaryrefslogtreecommitdiff
path: root/block/blkreplay.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-07-15 17:22:59 -0600
committerStefan Hajnoczi <stefanha@redhat.com>2016-07-20 14:11:55 +0100
commitaba76e2f0313178487e471bb55d022a89056c954 (patch)
tree33f2e495db46be716db43e6a301175c0b997b3e1 /block/blkreplay.c
parent47a5486d598e0cfef6c87c5f44b85955a5f2c4ff (diff)
blkreplay: Switch .bdrv_co_discard() to byte-based
Another step towards killing off sector-based block APIs. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1468624988-423-11-git-send-email-eblake@redhat.com Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/blkreplay.c')
-rwxr-xr-xblock/blkreplay.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/block/blkreplay.c b/block/blkreplay.c
index c69e5a57a0..30f9d5ff6c 100755
--- a/block/blkreplay.c
+++ b/block/blkreplay.c
@@ -114,12 +114,11 @@ static int coroutine_fn blkreplay_co_pwrite_zeroes(BlockDriverState *bs,
return ret;
}
-static int coroutine_fn blkreplay_co_discard(BlockDriverState *bs,
- int64_t sector_num, int nb_sectors)
+static int coroutine_fn blkreplay_co_pdiscard(BlockDriverState *bs,
+ int64_t offset, int count)
{
uint64_t reqid = request_id++;
- int ret = bdrv_co_pdiscard(bs->file->bs, sector_num << BDRV_SECTOR_BITS,
- nb_sectors << BDRV_SECTOR_BITS);
+ int ret = bdrv_co_pdiscard(bs->file->bs, offset, count);
block_request_create(reqid, bs, qemu_coroutine_self());
qemu_coroutine_yield();
@@ -149,7 +148,7 @@ static BlockDriver bdrv_blkreplay = {
.bdrv_co_pwritev = blkreplay_co_pwritev,
.bdrv_co_pwrite_zeroes = blkreplay_co_pwrite_zeroes,
- .bdrv_co_discard = blkreplay_co_discard,
+ .bdrv_co_pdiscard = blkreplay_co_pdiscard,
.bdrv_co_flush = blkreplay_co_flush,
};