mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
vmdk: Convert to bdrv_co_pwrite_zeroes()
Another step on our continuing quest to switch to byte-based interfaces. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
39ad937e16
commit
a620f2ae15
1 changed files with 5 additions and 7 deletions
12
block/vmdk.c
12
block/vmdk.c
|
@ -1703,15 +1703,13 @@ static int vmdk_write_compressed(BlockDriverState *bs,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int coroutine_fn vmdk_co_write_zeroes(BlockDriverState *bs,
|
static int coroutine_fn vmdk_co_pwrite_zeroes(BlockDriverState *bs,
|
||||||
int64_t sector_num,
|
int64_t offset,
|
||||||
int nb_sectors,
|
int bytes,
|
||||||
BdrvRequestFlags flags)
|
BdrvRequestFlags flags)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
BDRVVmdkState *s = bs->opaque;
|
BDRVVmdkState *s = bs->opaque;
|
||||||
uint64_t offset = sector_num * BDRV_SECTOR_SIZE;
|
|
||||||
uint64_t bytes = nb_sectors * BDRV_SECTOR_SIZE;
|
|
||||||
|
|
||||||
qemu_co_mutex_lock(&s->lock);
|
qemu_co_mutex_lock(&s->lock);
|
||||||
/* write zeroes could fail if sectors not aligned to cluster, test it with
|
/* write zeroes could fail if sectors not aligned to cluster, test it with
|
||||||
|
@ -2402,7 +2400,7 @@ static BlockDriver bdrv_vmdk = {
|
||||||
.bdrv_co_preadv = vmdk_co_preadv,
|
.bdrv_co_preadv = vmdk_co_preadv,
|
||||||
.bdrv_co_pwritev = vmdk_co_pwritev,
|
.bdrv_co_pwritev = vmdk_co_pwritev,
|
||||||
.bdrv_write_compressed = vmdk_write_compressed,
|
.bdrv_write_compressed = vmdk_write_compressed,
|
||||||
.bdrv_co_write_zeroes = vmdk_co_write_zeroes,
|
.bdrv_co_pwrite_zeroes = vmdk_co_pwrite_zeroes,
|
||||||
.bdrv_close = vmdk_close,
|
.bdrv_close = vmdk_close,
|
||||||
.bdrv_create = vmdk_create,
|
.bdrv_create = vmdk_create,
|
||||||
.bdrv_co_flush_to_disk = vmdk_co_flush,
|
.bdrv_co_flush_to_disk = vmdk_co_flush,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue