Re: [Qemu-devel] [PATCH v4 7/8] nbd: Implement NBD_INFO_BLOCK_SIZE on server

2017-02-23 Thread Eric Blake
On 02/23/2017 07:13 AM, Paolo Bonzini wrote: > > > On 22/02/2017 21:34, Eric Blake wrote: >> >>> Oh, so it's the smallest "good" transfer size, or the preferred >>> alignment. That's not the same as the SCSI definition, which is: >>> >>>If a device server receives one of these commands with

Re: [Qemu-devel] [PATCH v4 7/8] nbd: Implement NBD_INFO_BLOCK_SIZE on server

2017-02-23 Thread Paolo Bonzini
On 22/02/2017 21:34, Eric Blake wrote: > >> Oh, so it's the smallest "good" transfer size, or the preferred >> alignment. That's not the same as the SCSI definition, which is: >> >>If a device server receives one of these commands with a transfer >>size greater than this value, then the

Re: [Qemu-devel] [PATCH v4 7/8] nbd: Implement NBD_INFO_BLOCK_SIZE on server

2017-02-22 Thread Eric Blake
On 02/22/2017 11:26 AM, Paolo Bonzini wrote: > > > On 22/02/2017 18:11, Eric Blake wrote: +/* preferred - At least 4096, but larger as appropriate. */ +sizes[1] = MAX(blk_get_opt_transfer(exp->blk), 4096); >> >> The NBD specification requires a non-zero power-of-2 number if the

Re: [Qemu-devel] [PATCH v4 7/8] nbd: Implement NBD_INFO_BLOCK_SIZE on server

2017-02-22 Thread Paolo Bonzini
On 22/02/2017 18:11, Eric Blake wrote: >>> +/* preferred - At least 4096, but larger as appropriate. */ >>> +sizes[1] = MAX(blk_get_opt_transfer(exp->blk), 4096); > > The NBD specification requires a non-zero power-of-2 number if the > server transmits the block size at all; 1 is the idea

Re: [Qemu-devel] [PATCH v4 7/8] nbd: Implement NBD_INFO_BLOCK_SIZE on server

2017-02-22 Thread Eric Blake
On 02/22/2017 10:51 AM, Paolo Bonzini wrote: > > > On 21/02/2017 03:42, Eric Blake wrote: >> +/* Send NBD_INFO_BLOCK_SIZE always, but tweak the minimum size >> + * according to whether the client requested it, and according to >> + * whether this is OPT_INFO or OPT_GO. */ >> +/* m

Re: [Qemu-devel] [PATCH v4 7/8] nbd: Implement NBD_INFO_BLOCK_SIZE on server

2017-02-22 Thread Paolo Bonzini
On 21/02/2017 03:42, Eric Blake wrote: > +/* Send NBD_INFO_BLOCK_SIZE always, but tweak the minimum size > + * according to whether the client requested it, and according to > + * whether this is OPT_INFO or OPT_GO. */ > +/* minimum - 1 for back-compat, or 512 if client is new eno

[Qemu-devel] [PATCH v4 7/8] nbd: Implement NBD_INFO_BLOCK_SIZE on server

2017-02-20 Thread Eric Blake
The upstream NBD Protocol has defined a new extension to allow the server to advertise block sizes to the client, as well as a way for the client to inform the server that it intends to obey block sizes. Thanks to a recent fix (commit df7b97ff), our real minimum transfer size is always 1 (the bloc