[Qemu-block] [PATCH 1/1] nbd: implement bdrv_get_info callback

2018-01-18 Thread Edgar Kaziakhmedov
Since mirror job supports efficient zero out target mechanism (see in mirror_dirty_init()), implement bdrv_get_info to make it work over NBD. Such improvement will allow using the largest chunk possible and will decrease the number of NBD_CMD_WRITE_ZEROES requests on the wire. Signed-off-by: Edgar

Re: [Qemu-block] [PATCH 1/1] nbd: implement bdrv_get_info callback

2018-01-18 Thread Paolo Bonzini
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 fla

Re: [Qemu-block] [PATCH 1/1] nbd: implement bdrv_get_info callback

2018-01-26 Thread Edgar Kaziakhmedov
PIng So, let me know if I need to make any changes in patch On 1/18/18 1:09 PM, Paolo Bonzini wrote: 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->ca

Re: [Qemu-block] [PATCH 1/1] nbd: implement bdrv_get_info callback

2018-01-26 Thread Eric Blake
On 01/26/2018 06:39 AM, Edgar Kaziakhmedov wrote: > PIng > > So, let me know if I need to make any changes in patch > > On 1/18/18 1:09 PM, Paolo Bonzini wrote: >> On 18/01/2018 12:51, Edgar Kaziakhmedov wrote: >>> +static int nbd_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) >>> +{ >>> + 

Re: [Qemu-block] [PATCH 1/1] nbd: implement bdrv_get_info callback

2018-02-02 Thread Edgar Kaziakhmedov
On 01/26/2018 05:28 PM, Eric Blake wrote: On 01/26/2018 06:39 AM, Edgar Kaziakhmedov wrote: PIng So, let me know if I need to make any changes in patch On 1/18/18 1:09 PM, Paolo Bonzini wrote: On 18/01/2018 12:51, Edgar Kaziakhmedov wrote: +static int nbd_get_info(BlockDriverState *bs, Blo

Re: [Qemu-block] [PATCH 1/1] nbd: implement bdrv_get_info callback

2018-02-02 Thread Edgar Kaziakhmedov
On 02/02/2018 05:15 PM, Eric Blake wrote: 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, wh

Re: [Qemu-block] [PATCH 1/1] nbd: implement bdrv_get_info callback

2018-02-02 Thread Eric Blake
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? >> Actuall