diff --git a/src/client/qemu_driver.c b/src/client/qemu_driver.c index d8356dab..5f4cd50d 100644 --- a/src/client/qemu_driver.c +++ b/src/client/qemu_driver.c @@ -974,14 +974,21 @@ static void vitastor_co_read_bitmap_cb(void *opaque, long retval, uint8_t *bitma #endif } -static int coroutine_fn vitastor_co_block_status( - BlockDriverState *bs, bool want_zero, int64_t offset, int64_t bytes, - int64_t *pnum, int64_t *map, BlockDriverState **file) +static int coroutine_fn vitastor_co_block_status(BlockDriverState *bs, +#if QEMU_VERSION_MAJOR > 10 || QEMU_VERSION_MAJOR == 10 && QEMU_VERSION_MINOR >= 1 + unsigned int mode, +#else + bool want_zero, +#endif + int64_t offset, int64_t bytes, int64_t *pnum, int64_t *map, BlockDriverState **file) { // Allocated => return BDRV_BLOCK_DATA|BDRV_BLOCK_OFFSET_VALID // Not allocated => return 0 // Error => return -errno // Set pnum to length of the extent, `*map` = `offset`, `*file` = `bs` +#if QEMU_VERSION_MAJOR > 10 || QEMU_VERSION_MAJOR == 10 && QEMU_VERSION_MINOR >= 1 + int want_zero = (mode == BDRV_WANT_PRECISE); +#endif VitastorRPC task; VitastorClient *client = bs->opaque; uint64_t inode = client->watch ? vitastor_c_inode_get_num(client->watch) : client->inode;