On 03/29/2016 05:01 PM, Eric Blake wrote: > The existing transmission phase protocol is difficult to sniff, > because correct interpretation of the server stream requires > context from the client stream (or risks false positives if > data payloads happen to contain the protocol magic numbers). It > also prohibits the ability to do efficient sparse reads, or to > return a short read where an error is reported without also > sending length bytes of (bogus) data. > > +* `NBD_CMD_READ` > + > + If `NBD_OPT_STRUCTURED_READ` was not negotiated, then a read > + request MUST always be answered by a single non-structured > + response, as documented above (using magic 0x67446698 > + `NBD_REPLY_MAGIC`, and containing length bytes of data according > + to the client's request, although those bytes MAY be invalid if an > + error is returned, and the connection MUST if an error occurs MUST be closed (I hate it when I send patches before 'git commit --amend' on the final unsaved changes in my editor...) > + after a header claiming no error). > + -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org