On 18/01/2018 12:51, Edgar Kaziakhmedov wrote:
> 
> +static int nbd_get_info(BlockDriverState *bs, BlockDriverInfo *bdi)
> +{
> +    if (bs->supported_zero_flags & BDRV_REQ_MAY_UNMAP) {
> +        bdi->can_write_zeroes_with_unmap = true;
> +    }
> +    return 0;
> +}
> +

Other drivers set the flag always, while NBD only sets it if the server
knows the flag.

I think NBD is more correct, so:

Reviewed-by: Paolo Bonzini <pbonz...@redhat.com>

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?

Paolo

Reply via email to