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

Re: [Xen-devel] [PATCH v9 02/25] docs/libxl: Introduce COLO_CONTEXT to support migration v2 colo streams



Andrew Cooper writes ("Re: [Xen-devel] [PATCH v9 02/25] docs/libxl: Introduce 
COLO_CONTEXT to support migration v2 colo streams"):
> On 27/01/16 15:28, Konrad Rzeszutek Wilk wrote:
> > On Wed, Jan 27, 2016 at 03:15:47PM +0000, Andrew Cooper wrote:
> >> Mandatory records may not be ignored, and constitutes a hard
> >> error.  Optional records may be ignored, without error, if they
> >> are not understood.

`Mandatory' is a somewhat misleading term.  (In a past life we called
these different kinds of protocol extension `harmful' and `harmless'.
A `harmless' extension is one that is safe to ignore if the receiver
does not know about the extension.  A `harmful' extension will always
cause a naive receiver to get a parse error.)

> > You are still not answering my question.
> >
> > Is it a hard error if the mandatory record is zero length?
>
> Not if the type specifies that a zero length record is permitted.

This is misleading.  Obviously the behaviour of a naive receiver
cannot depend on the specification document for the type, because that
specification document was written after the type was invented.


Let me provide an exhaustive case analysis:

  Optional or   Value sent    Receiver knows   Receiver
   Mandatory                  about the type?   behaviour

  Optional or   No record of    Yes        Depends on type
  Mandatory     this type                 spec and semantics;
                                          reciever may fail
                                          if information is
                                          required.

  Optional or   Empty           Yes        Depends on type
  Mandatory      record(s)                spec and semantics;
                                          empty record might be
                                          invalid or semantically
                                          inappropriate (eg
                                          inconsistent with
                                          other info)

  Optional or   Nonempty        Yes        Depends on type
  Mandatory      record(s)                spec and semantics

  Optional or   No record of    No         Whatever it does
  Mandatory     this type                 normally, obviously



And these are the only cases where `Optional' or `Mandatory' makes a
difference:

  Optional      Empty           No         Record(s) silently
                 record(s)                discarded by receiver

  Optional      Nonempty        No         Record(s) silently
                 record(s)                discarded by receiver

  Mandatory     Empty           No         Receiver ABORTS
                 record(s)                entire operation

  Mandatory     Nonempty        No         Receiver ABORTS
                 record(s)                entire operation



There is nothing special about empty records.  Indeed an empty record
can be used as a flag.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.