[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Nbd] Processing client's option list



On Sun, May 29, 2011 at 10:59:37AM +0100, Alex Bligh wrote:
> Wouter,
> 
> --On 29 May 2011 11:29:14 +0200 Wouter Verhelst <w@...112...> wrote:
> 
> >I overlooked that when I defined the new negotiation. Worse, it's not
> >possible to add new messages without breaking the protocol, since the
> >server doesn't currently ignore any options it doesn't know about.
> >
> >So, here's a suggestion:
> >- The server sets a flag "I have a fixed new-style negotiation
> >  implementation"
> >- The client replies with a similar flag.
> >- Only if both client and server have set that bit can extra options be
> >  used. In that case, the server must continue reading data until it
> >  reads a packet NBD_OPT_END, with zero length. It must echo that back
> >  to the client when it has nothing more to say.
> >- The server must not send any data to the client beyond what is
> >  required for any explicit requests by the client and the NBD_OPT_END
> >  packet.
> >
> >This way, both the client and the server will know when negotiation is
> >finished, even if one or the other does not implement an option that is
> >requested by the other end.
> 
> I don't think you mean "packet". I think you just mean "option". They
> need not be separate tcp packets. Otherwise yes, I agree.

Yes, obviously. Sorry 'bout that; courtesy of reading mail before
breakfast ;-)

> Alternatively, if we have room, perhaps the server could indicate
> what protocol revision it supports, then the client could reply
> with a number less than or equal to that, and we could just do
> revisions of protocols, rather than trying to support all sorts
> of different things orthogonally.

I don't think a concept of "protocol revision" is a good idea in
general. We may have options in the future that only make sense on
particular platforms. We may have options that we only want to set if
something is set in the config file. There are already several alternate
implementations today, and it might make sense for them to not implement
particular options (or to implement some that we don't). Etc.

So I really want to negotiate features, not version numbers.

-- 
The volume of a pizza of thickness a and radius z can be described by
the following formula:

pi zz a



Reply to: