On 02/02/2018 08:06 AM, Edgar Kaziakhmedov wrote: >>>> However, it would be nice to remove can_write_zeroes_with_unmap from >>>> BlockDriverInfo, and make bdrv_can_write_zeroes_with_unmap just return >>>> !!(bs->supported_zero_flags & BDRV_REQ_MAY_UNMAP). Kevin, what do you >>>> think? >> Actually, I may even just give a shot at writing this alternative patch, >> to make Kevin's decision easier. > But actually qcow2 performs some checks for version inside get_info > callback before setting can_write_zeroes_with_unmap flag, > so we can't take into account such checks in > bdrv_can_write_zeroes_with_unmap subroutine. Therefore, I don't think it > is possible to do it like that.
Here's the patch I proposed (it looks like I forgot to CC you): https://lists.gnu.org/archive/html/qemu-devel/2018-01/msg06471.html -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
Description: OpenPGP digital signature