[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 1/1] nbd: implement bdrv_get_info callback
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-block] [PATCH 1/1] nbd: implement bdrv_get_info callback |
Date: |
Thu, 18 Jan 2018 13:09:42 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 |
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 <address@hidden>
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