Re: [Nbd] [PATCH v4 04/11] nbd: Improve server handling of bogus commands

2016-06-13 Thread Eric Blake
[adding nbd list] On 06/13/2016 06:10 AM, Paolo Bonzini wrote: > > > On 12/05/2016 00:39, Eric Blake wrote: >> - If we report an error to NBD_CMD_READ, we are not writing out >> any data payload; but the protocol says that a client can expect >> to read the paylo

Re: [Nbd] [PATCH 1/2] nbd: make nbd device wait for its users

2016-06-24 Thread Eric Blake
open until the last user > closes the block device. This offers the possibility as well to open a > new socket to be used while the filesystems are mounted. > > Signed-off-by: Pranay Kr. Srivastava <pran...@gmail.com> > > [mpa: Keep the blockdevice open until all users left] &

Re: [Nbd] [PATCH 3/3]nbd: make nbd device wait for its users

2016-06-24 Thread Eric Blake
<pran...@gmail.com> > --- > drivers/block/nbd.c | 124 > ---- > 1 file changed, 96 insertions(+), 28 deletions(-) > -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library

Re: [Nbd] [Qemu-devel] [RFC 1/1] nbd (specification): add NBD_CMD_WRITE_ZEROES command

2016-02-17 Thread Eric Blake
h holes during writes. Do we have the converse operation, that is, an easy way to query if a block of data will read as all zeroes, and therefore the client can bypass reading that portion of the disk (in other words, an equivalent to lseek(SEEK_HOLE/SEEK_DATA))? -- Eric Blake

Re: [Nbd] [Qemu-devel] [RFC 1/1] nbd (specification): add NBD_CMD_WRITE_ZEROES command

2016-02-18 Thread Eric Blake
On 02/18/2016 02:18 AM, Roman Kagan wrote: > On Wed, Feb 17, 2016 at 01:58:47PM -0700, Eric Blake wrote: >> On 02/17/2016 11:10 AM, Denis V. Lunev wrote: >>> @@ -446,6 +448,11 @@ The following request types exist: >>> about the contents of the export affe

Re: [Nbd] [PATCH 3/3] NBD proto: add "Command flags" section

2016-03-29 Thread Eric Blake
On 03/29/2016 10:01 AM, Eric Blake wrote: > On 03/28/2016 04:43 AM, Denis V. Lunev wrote: >> From: Pavel Borzenkov <pborzen...@virtuozzo.com> >> >> Add separate "Command flags" section to make it clear which flags are >> currently defined by the pro

Re: [Nbd] [PATCH 3/3] NBD proto: add "Command flags" section

2016-03-29 Thread Eric Blake
uozzo.com> > Reviewed-by: Roman Kagan <rka...@virtuozzo.com> > Signed-off-by: Denis V. Lunev <d...@openvz.org> > CC: Wouter Verhelst <w...@uter.be> > CC: Eric Blake <ebl...@redhat.com> > CC: Alex Bligh <a...@alex.org.uk> > --- > doc/proto.

Re: [Nbd] [Qemu-devel] [PATCH v2 3/3] doc: Propose Structured Read extension

2016-03-30 Thread Eric Blake
visits the chunks in the correct order (not necessarily in the order received). Clients that really don't want to do much work have the DF flag to forbid fragmentation. But I think you've swayed me - I will make sure v3 allows an error at any point in the chain of chunks, and that the wording

Re: [Nbd] [PATCH v2 3/3] doc: Propose Structured Read extension

2016-03-30 Thread Eric Blake
ot; > flags field as the "negotiation flags field" which signals incompatible Maybe "handshake flags" instead, since we document handshake/transmission phases? > changes in the negotiation phase, and the "per-export" flags field as > the "transmissio

Re: [Nbd] [PATCHv2] Strawman proposal for NBD structured replies

2016-03-30 Thread Eric Blake
On 03/30/2016 01:33 AM, Wouter Verhelst wrote: > Morning, > > On Wed, Mar 30, 2016 at 07:59:15AM +0100, Alex Bligh wrote: >> On 30 Mar 2016, at 00:17, Eric Blake <ebl...@redhat.com> wrote: >>>> >>>> -The server replies with: >>>> +Rep

Re: [Nbd] [Qemu-devel] [PATCH v2 3/3] doc: Propose Structured Read extension

2016-03-30 Thread Eric Blake
are bits I've got that you haven't (as well as vice versa). > But I'm inclined to use yours as a base unless you particularly > like mine. > > Comments inline below. > > Alex > > On 30 Mar 2016, at 00:01, Eric Blake <ebl...@redhat.com> wrote: > ... > >> +

[Nbd] NBD_REP_SERVER layout [was: [Qemu-devel] [PATCHv2] Strawman proposal for NBD structured replies]

2016-03-30 Thread Eric Blake
On 03/30/2016 12:43 PM, Eric Blake wrote: > On that tangent, I found SELECT slightly ambiguous (particularly since > I'm also considering a proposal to modify NBD_REP_SERVER to expose > alignment details, so it would have to play nicely with SELECT): > > Based on normative text

[Nbd] [PATCH v3 5/5] RFC: doc: Promote structured reply out of experimental

2016-03-31 Thread Eric Blake
indentation). Signed-off-by: Eric Blake <ebl...@redhat.com> --- doc/proto.md | 621 ++- 1 file changed, 273 insertions(+), 348 deletions(-) diff --git a/doc/proto.md b/doc/proto.md index cd59d81..7bc65f8 100644 --- a/doc/proto.md +++ b/doc/pr

[Nbd] [PATCH v3 0/5] Structured replies

2016-03-31 Thread Eric Blake
within a larger structured reply Eric Blake (5): doc: Minor consistency issues doc: Clean up wording on UTF-8 and REP_SERVER usage doc: Reformat description of Transmission phase doc: Propose STRUCTURED_REPLY extension RFC: doc: Promote structured reply out of experimental doc/proto.md

[Nbd] [PATCH v3 4/5] doc: Propose STRUCTURED_REPLY extension

2016-03-31 Thread Eric Blake
to be able to observe as option haggling progresses. Signed-off-by: Eric Blake <ebl...@redhat.com> --- doc/proto.md | 391 --- 1 file changed, 374 insertions(+), 17 deletions(-) diff --git a/doc/proto.md b/doc/proto.md index c1e05c5..c

[Nbd] [PATCH v3 2/5] doc: Clean up wording on UTF-8 and REP_SERVER usage

2016-03-31 Thread Eric Blake
about SELECT changing the semantics of the extra data is not a field within the data). Signed-off-by: Eric Blake <ebl...@redhat.com> --- doc/proto.md | 46 -- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/doc/proto.md b/doc/proto.md

Re: [Nbd] [Qemu-devel] [PATCH v2 3/3] doc: Propose Structured Read extension

2016-03-30 Thread Eric Blake
don't see how haggling structured replies before encryption is a data leak (I _do_ see how NBD_OPT_LIST could be a security leak on an unencrypted connection, but that's different) - so maybe we need to revisit the wording on when it is fair game for a server to reply with ERR_TLS_REQD. -

Re: [Nbd] [PATCH v2] doc: Add NBD_CMD_BLOCK_STATUS extension

2016-04-05 Thread Eric Blake
nd and so on. Is it safe to cache this stuff? If the client is the only thing modifying the drive, maybe we want to make that additional constraint on the server. But how best to word it, or is it too tight of a specification? > > Until now something like READ and WRITE where somehow atomic

Re: [Nbd] [PATCHv3] Improve the documentation of NBD_CMD_FLUSH and NBD_CMD_FLAG_FUA.

2016-04-05 Thread Eric Blake
_FUA` flag ("Force Unit Access") was set in the > -transmission flags field, the client MAY set the flag `NBD_CMD_FLAG_FUA` > in > -the command flags field. If this flag was set, the server MUST NOT send > -the reply until it has ensured that the newly-written data has

Re: [Nbd] NBD_OPT_GO

2016-04-05 Thread Eric Blake
y handle the empty name as selecting the default export, but NBD_OPT_GO would be ambiguous as to whether you are using it without a name option, or if you are using the optional name option to explicitly select the default export. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt vir

Re: [Nbd] NBD_OPT_SELECT client implementations

2016-04-05 Thread Eric Blake
o support it, and will have something posted later this week. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital

Re: [Nbd] [PATCH] docs/proto.md: Clarify SHOULD / MUST / MAY etc

2016-04-06 Thread Eric Blake
a link to https://www.ietf.org/rfc/rfc2119.txt? Other than that, this looks fine; getting it in sooner, rather than later, will avoid having to rebase it on all the other changes floating around. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.or

Re: [Nbd] [PATCH] docs/proto.md: Clarify SHOULD / MUST / MAY etc

2016-04-06 Thread Eric Blake
o make the final decision on boldness; but definitely agree that the normative changes should be separate (and go in now) from the typographical changes (whether or not we decide to take the bold). -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualizat

Re: [Nbd] [PATCH] Document NBD_CMD_CLOSE

2016-04-07 Thread Eric Blake
efore the server has received or processed the > +`NBD_CMD_DISC`, particularly when TLS is enabled. This > +extension allows both client and server to be sure a connection > +has been closed safely and to diff

Re: [Nbd] [PATCH] Improve documentation for TLS

2016-04-07 Thread Eric Blake
al downgrade attack SHOULD either > used FORCEDTLS mode, or should force TLS on those exports > it is concerned about using SELECTIVE mode and TLS-only > exports. It is not possible to avoid downgrade attacks > on exports which are may be served either via TLS or > in plain tex

Re: [Nbd] [PATCH] Improve documentation for TLS

2016-04-07 Thread Eric Blake
> Both the QEMU NBD server and NBD clients only implement FORCEDTLS. which is fine. You don't have to implement all four server modes to be compliant to the protocol, implementing just one is okay. > ie you tell the client to use TLS and it will refuse to talk to a > server which doesn't

Re: [Nbd] [PATCH] Improve documentation for TLS

2016-04-07 Thread Eric Blake
tion. > - `NBD_REP_ERR_UNKNOWN`: The chosen export does not exist on this >server. > - `NBD_REP_ERR_TLS_REQD`: The server does not wish to export this > - block device unless the client negotiates TLS first. > + block device unless the client initia

Re: [Nbd] [PATCH v6 1/2] doc: Clean up wording about INFO then GO response

2016-04-07 Thread Eric Blake
gt; I'm a bit puzzled as to how that was a lowercase 'should' in the first > place. It's upper case after applying v5 of my SHOULD/MUST/MAY > patch. Just wondering in case there is anything else missed. It's because patch 1/2 is applied _prior_ to your SHOULD/MUST/MAY. I think it's all correct

Re: [Nbd] [PATCHv2] Improve documentation for TLS

2016-04-07 Thread Eric Blake
dshake is unsuccessful (for instance the server's > +certificate does not validate) the client MUST disconnect as > +by this stage it is too late to continue without TLS. > + > + > +### Security considerations > + > +#### TLS versions > + We crossed mail; I had some revie

Re: [Nbd] [PATCHv2] Document NBD_CMD_CLOSE

2016-04-07 Thread Eric Blake
' language. > > Changes from v1: > > * Make a NBD_CMD_CLOSE imply a flush > > * Nits from Eric Blake > > diff --git a/doc/proto.md b/doc/proto.md > index e5042aa..86dac02 100644 > --- a/doc/proto.md > +++ b/doc/proto.md > @@ -342,6 +342,7 @@ The field has the fo

Re: [Nbd] [Qemu-devel] [PATCH v2] doc: Add NBD_CMD_BLOCK_STATUS extension

2016-04-07 Thread Eric Blake
information if received out of order. Allowing for a short reply seems to be worth doing, but allowing for multiple reply chunks seems not worth the risk. I'm also starting to think that it is worth FIRST documenting an extension for advertising block sizes, so that we can then couch BLOCK_STATUS in th

Re: [Nbd] [PATCHv3] Improve documentation for TLS

2016-04-07 Thread Eric Blake
ng in SELECTIVETLS mode, where the entry concerned is a TLS-only export. Maybe even strengthen it to SHOULD, particularly given my above side note about qemu's usage of NBD_OPT_LIST to determine if a plaintext client is talking to a server that wants TLS. I'm down to just 2 findings and a side comm

Re: [Nbd] [PATCHv3] Document NBD_CMD_CLOSE

2016-04-07 Thread Eric Blake
case matters enough to complicate the wording. With that tweak, Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org s

Re: [Nbd] Current status of patches

2016-04-07 Thread Eric Blake
go ahead and post a v6 of your patch along with mine, ready for use on current nbd.git master. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

[Nbd] [PATCH v6 2/2] docs/proto.md: Clarify SHOULD / MUST / MAY etc

2016-04-07 Thread Eric Blake
.org.uk> Signed-off-by: Eric Blake <ebl...@redhat.com> --- doc/proto.md | 92 1 file changed, 55 insertions(+), 37 deletions(-) diff --git a/doc/proto.md b/doc/proto.md index a81b59c..0c5bb5d 100644 --- a/doc/proto.md +++ b/doc/

[Nbd] [PATCH v6 1/2] doc: Clean up wording about INFO then GO response

2016-04-07 Thread Eric Blake
ordering so that NBD_REP_SERVER details aren't split by a side-note about NBD_REP_ERR_UNSUP. Signed-off-by: Eric Blake <ebl...@redhat.com> --- doc/proto.md | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/doc/proto.md b/doc/proto.md index f117394..a

Re: [Nbd] NBD_OPT_GO

2016-04-05 Thread Eric Blake
have to. And NBD_OPT_GO does not do any magic to the empty string beyond what NBD_OPT_EXPORT_NAME already does, and does not care whether any earlier NBD_OPT_LIST or NBD_OPT_SELECT (or if we rename it NBD_OPT_INFO) took place. -- Eric Blake eblake redhat

Re: [Nbd] [PATCH] Amend NBD_OPT_SELECT and NBD_OPT_GO documentation

2016-04-05 Thread Eric Blake
ticular reply until all other pending option requests have > +had their final reply. > > ### `WRITE_ZEROES` extension > > Overall makes sense. I wonder if we can compress things further by stating something along the lines of: * `NBD_OPT_GO` I

Re: [Nbd] [PATCH] Document format of strings in one place, limit to 4096 bytes

2016-04-06 Thread Eric Blake
pitalize the term String (or use any other typographical convention) to call out when we mean the UTF-8 string as defined above? -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization li

Re: [Nbd] [PATCHv2] Document format of strings in one place, limit to 4096 bytes

2016-04-06 Thread Eric Blake
r in the same message, although it may require some computation based on the size of other data also present in the same message. [yes, I meant 'may' not 'MAY' there] Otherwise looks good to me. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libv

Re: [Nbd] [PATCH] Document format of strings in one place, limit to 4096 bytes

2016-04-06 Thread Eric Blake
On 04/06/2016 02:37 PM, Eric Blake wrote: > On 04/06/2016 02:27 PM, Wouter Verhelst wrote: >> >> Also, most of those strings exist solely to make user interaction >> easier. In that context, a 4K string is *way* too long; I'm thinking >> something like 256 seems saner

Re: [Nbd] [PATCHv3] Document format of strings in one place, limit to 4096 bytes

2016-04-06 Thread Eric Blake
--- > doc/proto.md | 49 ++--- > 1 file changed, 26 insertions(+), 23 deletions(-) Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc De

Re: [Nbd] [PATCHv5] docs/proto.md: Clarify SHOULD / MUST / MAY etc

2016-04-06 Thread Eric Blake
o need a tweak. However, it may be worth fixing that as a followup patch, and letting this one through. Everything else is looking good from my perspective. -- Eric Blake eblake redhat com

Re: [Nbd] [PATCH v2] doc: Allow NBD_CMD_FLAG_NO_HOLE during NBD_CMD_WRITE

2016-04-05 Thread Eric Blake
On 04/05/2016 03:38 AM, Markus Pargmann wrote: > Hi, > > On Monday 04 April 2016 16:15:43 Eric Blake wrote: >> qemu already has an existing server implementation option that will >> explicitly search the payload of NBD_CMD_WRITE for large blocks of >> zeroes, and pu

Re: [Nbd] NBD_OPT_GO

2016-04-05 Thread Eric Blake
nt spec is experimental, and the > point about experimental bits of the specs is we can make changes, > particularly ones that only affect edge case. Indeed, and the more I see your arguments about an optional name to NBD_OPT_GO, the more it seems like a spec change should be okay. -- Eric Blake

[Nbd] [PATCH] doc: Revert swap of NBD_REP_SERVER fields in NBD_OPT_GO

2016-04-06 Thread Eric Blake
, and maximum block sizes). Signed-off-by: Eric Blake <ebl...@redhat.com> --- I'm trying to implement NBD_OPT_GO in qemu, and found the original order easier to support than the swapped order. doc/proto.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/proto.md

Re: [Nbd] [PATCHv2] Amend NBD_OPT_SELECT (now NBD_OPT_INFO) and NBD_OPT_GO documentation

2016-04-05 Thread Eric Blake
C_NO_ZEROES` flag. After sending this reply the server MUST > +immediately move to the transmission phase, and after receiving this > +reply, the client MUST immediately move to the transmission phase; > +therefore, the server MUST NOT send this particular reply until all > +

Re: [Nbd] [PATCH] Make include of "config.h" not use system include path

2016-04-11 Thread Eric Blake
.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Eric Blake <ebl...@redhat.com> > > diff --git a/nbd-debug.h b/nbd-debug.h > index ec8dfd2..f2b1af5 100644 > --- a/nbd-debug.h > +++ b/nbd-debug.h > @@ -1,6 +1,6 @@ > #ifndef NBD_DEBUG_H

Re: [Nbd] [PATCH] Docs: improve description of disconnection methods

2016-04-12 Thread Eric Blake
zeroes at the end of the negotiation. > > -Clients MUST NOT set any other flags; the server MUST drop the > +Clients MUST NOT set any other flags; the server MUST drop the TCP > connection if the client sets an unknown flag, or a flag that does > not match something advertised

[Nbd] [PATCH v2] doc: Add new NBD_REP_INFO reply, for advertising block size

2016-04-12 Thread Eric Blake
not know about, and that we can easily add future items of information. Signed-off-by: Eric Blake <ebl...@redhat.com> --- v2: add new NBD_REP_INFO, ditch NBD_FLAG_BLOCK_SIZE, create new subsection "Block sizes" rather than repeating information, more details on sizing constraint

[Nbd] [RFC PATCH 00/18] NBD protocol additions

2016-04-08 Thread Eric Blake
-flags-v2 Tag is named v2 because patches 1 and 2 in this grouping have been previously posted for inclusion in qemu 2.6 Eric Blake (18): nbd: Don't kill server on client that doesn't request TLS nbd: Don't fail handshake on NBD_OPT_LIST descriptions nbd: More debug typo fixes, use correct

Re: [Nbd] [PATCHv4] Document NBD_CMD_CLOSE

2016-04-08 Thread Eric Blake
On 04/07/2016 11:46 PM, Alex Bligh wrote: > > On 8 Apr 2016, at 04:31, Eric Blake <ebl...@redhat.com> wrote: > >> Should we be sticking this in the Experimental Extensions section, until >> we have an implementation? > > Not every change needs go through

[Nbd] [RFC PATCH] doc: In STRUCTURED_REPLY, make error types easy to recognize

2016-04-08 Thread Eric Blake
sending something the client isn't expecting, but covering the situation from both sides never hurts. Also, marking error types resembles how NBD_REP_ERR_* has a common layout. Signed-off-by: Eric Blake <ebl...@redhat.com> --- Applies on top of the v6 SHOULD/MUST/MAY patch. doc/proto.m

[Nbd] [RFC PATCH] doc: Add new NBD_FLAG_BLOCK_SIZE extension

2016-04-11 Thread Eric Blake
flag handshake means the rest of the session has consistent message sizing. Signed-off-by: Eric Blake <ebl...@redhat.com> --- Perhaps I should try harder to make the an experimental extension, rather than directly placing it into the normative section. But I wanted to first get

Re: [Nbd] [RFC PATCH] doc: Add new NBD_FLAG_BLOCK_SIZE extension

2016-04-12 Thread Eric Blake
On 04/12/2016 04:34 AM, Alex Bligh wrote: > > On 12 Apr 2016, at 05:04, Eric Blake <ebl...@redhat.com> wrote: > >> Existing NBD servers often have limitations, such as requiring >> actions to be aligned to block sizes or limiting maximum >> transactions t

Re: [Nbd] NBD_CMD_DISC

2016-04-12 Thread Eric Blake
y play with the TCP cork; it seems like layering-wise, if we have situations where a block device wants to set the TCP cork when running plaintext, it would also want to set the TLS cork when running TLS. But that's a question for the qemu folks. -- Eric Blake eblake redhat com+1-919-301-326

Re: [Nbd] NBD_CMD_DISC

2016-04-09 Thread Eric Blake
[adding qemu list and Dan into the mix] On 04/09/2016 05:02 PM, Alex Bligh wrote: > > On 9 Apr 2016, at 22:12, Eric Blake <ebl...@redhat.com> wrote: > >>> How would the client know that? I'm using Go's TLS library, and there is >>> no way (as far as I can tel

Re: [Nbd] [PATCHv6] Improve documentation for TLS

2016-04-09 Thread Eric Blake
a server. > > * Add text defining what 'terminate the session' means during > negotiation, and when it is available. > > Reviewed-by: Eric Blake <ebl...@redhat.com> > Signed-off-by: Alex Bligh <a...@alex.org.uk> > --- > doc/proto.md | 338 > +++

Re: [Nbd] [PATCH] doc/proto.md: NBD_OPT_STARTTLS cannot be used twice

2016-04-06 Thread Eric Blake
- > 1 file changed, 4 insertions(+), 1 deletion(-) Reviewed-by: Eric Blake <ebl...@redhat.com> -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc De

Re: [Nbd] [PATCH v2] doc: Add NBD_CMD_BLOCK_STATUS extension

2016-04-06 Thread Eric Blake
quot;all 1" for unknown > flag. This would provide nice forward compatibility. My v2 approach was to define the status so that "all 0" was the safe default (hence, naming the flag "NBD_STATUS_CLEAN" and set to 1 only when no longer dirty, not "NBD_STATUS_DIRTY" where

Re: [Nbd] doc/proto.md: TLS question

2016-04-06 Thread Eric Blake
LS_REQD after successful NBD_OPT_STARTTLS - client that does not know TLS will be unable to connect - client that knows TLS MUST negotiate TLS before doing anything else useful -- Eric Blake eblake redhat com+1-919-30

[Nbd] [PATCH] doc: Wording cleanups

2016-04-06 Thread Eric Blake
Fix several document inconsistencies (missing references, rewrap long lines, address typos, improve grammar) introduced in recent patches. Signed-off-by: Eric Blake <ebl...@redhat.com> --- Note that there is still ongoing discussion about the correct layout to use for NBD_REP_SERVER in re

Re: [Nbd] [RFC PATCH] doc: In STRUCTURED_REPLY, make error types easy to recognize

2016-04-08 Thread Eric Blake
On 04/08/2016 11:17 AM, Alex Bligh wrote: > > On 8 Apr 2016, at 17:48, Eric Blake <ebl...@redhat.com> wrote: >> We may add future structured error replies; making it easy >> for older clients to properly treat such new reply types as >> an error gives us a bit more

Re: [Nbd] [PATCHv4] Document NBD_CMD_CLOSE

2016-04-07 Thread Eric Blake
> +A close request. The server MUST handle all outstanding That is, I suspect we need "Defined by the experimental `CLOSE` extension; see below." here, and the bulk of the text later in the document. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization librar

Re: [Nbd] [PATCH v6 0/2] SHOULD / MUST / MAY

2016-04-11 Thread Eric Blake
ping On 04/07/2016 03:29 PM, Eric Blake wrote: > v6: add another wording fixup, then rebase to master > > Since the two patches conflict, and since Alex' patch is a > conflict magnet for later patches, I'm hoping we can get > both of these in sooner rather than later. >

Re: [Nbd] [PATCHv6] docs/proto.md: Clarify SHOULD / MUST / MAY etc

2016-04-11 Thread Eric Blake
ter (less repetitive). But I'm fine waiting for yours to land (it is a conflict magnet, and the sooner we get it in, the less we have to keep rebasing it) before reposting my wording improvements. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.

Re: [Nbd] [PATCHv8] Improve documentation for TLS

2016-04-11 Thread Eric Blake
_ABORT first if the protocol >> permits. There are instances where this is impossible, such as after >> an NBD_OPT_EXPORTNAME has been issued, or on an unsuccessful >> negotiation of TLS. For instance, if the client does not find an >> export it is

Re: [Nbd] [Qemu-devel] [PATCH 1/2] NBD proto: add WRITE_ZEROES extension

2016-03-24 Thread Eric Blake
probably just fix my implementation instead. While I agree that you should fix your implementation, I am strongly in favor of a new command, so that we can blindly state that the NBD_CMD_WRITE always sends a payload of length bytes, independent of flag value. -- Eric Blake eblake redha

Re: [Nbd] [Qemu-devel] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension

2016-03-24 Thread Eric Blake
t can treat the extent as zeroes >> and reads will succeed >> 0x3 - LBA extent present, client can treat the extent as zeroes and >> reads will succeed > > I'm not sure that clients need this level of details. From client's POV > 0x2 and 0x3 are the same. No, if the client

Re: [Nbd] [Qemu-devel] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension

2016-03-24 Thread Eric Blake
locks as > dirty in the descriptor that it returns. Is it feasible to return zero/allocated/dirty status all at the same time, or do we want to strictly require two different modes of operation? That is, if we are returning zero and allocated as two bits, can we also return a third bit

Re: [Nbd] [Qemu-devel] [PATCH 1/2] NBD proto: add WRITE_ZEROES extension

2016-03-23 Thread Eric Blake
nd NBD_CMD_WRITE_ZEROES if NBD_FLAG_SEND_WRITE_ZEROES was not negotiated in the export options? Similarly, should we suggest that the server reply with EINVAL if it knows about the command, but the client issues the command in spite of not negotiating it? Should we enhance the documentation in the "Error

Re: [Nbd] [Qemu-devel] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension

2016-03-23 Thread Eric Blake
the meaning of the > +NBD_STATE_DIRTY or NBD_STATE_CLEAN states. > + > +The server SHOULD return `EINVAL` if it receives a `GET_LBA_STATUS` request > +including one or more sectors beyond the size of the device. As mentioned in the previous mail, should we also recommend an EINVAL if

Re: [Nbd] [Qemu-devel] [PATCH 2/2] NBD proto: add GET_LBA_STATUS extension

2016-03-24 Thread Eric Blake
structured length replies, it would be possible to allow for short reads and/or returning an error with 0 bytes of payload but still keeping the connection to the client open, without having to send wasted bytes over the wire. I could write up a negotiation of global flags for structured reply le

[Nbd] [PATCH] Fix doc typos

2016-03-24 Thread Eric Blake
Fix the spelling of "beef", and the case of an "NBD_REP" constant. Signed-off-by: Eric Blake <ebl...@redhat.com> --- I noticed these while reviewing the recent proposed spec additions for efficient sparse file handling doc/proto.md | 4 ++-- 1 file changed, 2

Re: [Nbd] Is NBD_CMD_FLAG_FUA valid during NBD_CMD_FLUSH?

2016-04-01 Thread Eric Blake
y tell if the behavior will be guaranteed. > I suppose I am going have to try another lkml message to get > to the bottom of the first one. On the other hand if we > take route (a) above, we can relatively easily add a > 'meaning' later as people can't have been re

Re: [Nbd] Is NBD_CMD_FLAG_FUA valid during NBD_CMD_FLUSH?

2016-04-01 Thread Eric Blake
fix NBD server to silently ignore FUA on flush (fix the breakage between the pairing). -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature

Re: [Nbd] [PATCH v2 1/1] NBD proto: add WRITE_ZEROES extension

2016-04-01 Thread Eric Blake
he default sense of this bit should be reversed. I'll propose a followup patch, now that the original has been merged. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature --

Re: [Nbd] [PATCH v4] doc: Propose STRUCTURED_REPLY extension

2016-04-01 Thread Eric Blake
tion if it detects that the server > > MUST? > >> +has sent invalid chunks (such as overlapping data, or not enough >> +data before claiming success). I'm intentionally using MAY here - depending on the client implementation, it is a

[Nbd] [PATCH] doc: Flip bit sense for allowing trim during WRITE_ZEROES

2016-04-01 Thread Eric Blake
that there is no dependency on whether NBD_CMD_TRIM is supported. Also tweak a couple of formatting issues for consistency (for example, only reserve a bit number in one place). Signed-off-by: Eric Blake <ebl...@redhat.com> --- doc/proto.md | 30 +- 1 file changed, 17 inse

[Nbd] [PATCH] doc: Cleanups to structured reads

2016-04-01 Thread Eric Blake
A couple of typos, odd formatting, and missing words made it into the structured read spec, and several potential ambiguous situations were worth rewording for clarity. Signed-off-by: Eric Blake <ebl...@redhat.com> Signed-off-by: Alex Bligh <a...@alex.org.uk> --- doc/pr

Re: [Nbd] [PATCH] doc/proto.md: restore formatting

2016-04-01 Thread Eric Blake
On 04/01/2016 07:30 AM, Eric Blake wrote: > On 04/01/2016 04:34 AM, Alex Bligh wrote: >> Restore formatting and correct name of 'length' >> >> Signed-off-by: Alex Bligh <a...@alex.org.uk> >> --- >> doc/proto.md | 4 ++-- >> 1 file changed, 2 inserti

Re: [Nbd] [PATCH] doc: Flip bit sense for allowing trim during WRITE_ZEROES

2016-04-04 Thread Eric Blake
On 04/01/2016 03:29 PM, Eric Blake wrote: > Rather than requiring allocation by default and allowing trims > only on request during WRITE_ZEROES, it seems like a better > default is to allow server optimizations by default and require > full allocation by specific request. Since

[Nbd] [PATCH] doc: Allow NBD_CMD_FLAG_NO_HOLE during NBD_CMD_WRITE

2016-04-04 Thread Eric Blake
zeroes rather than a hole. So it makes sense to let the new NBD_CMD_FLAG_NO_HOLE work for WRITE as well as WRITE_ZEROES. Signed-off-by: Eric Blake <ebl...@redhat.com> --- doc/proto.md | 33 +++-- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/doc/pr

[Nbd] [PATCH 2/1] doc: More details on flag negotiation

2016-03-28 Thread Eric Blake
oldstyle negotiation since a client has no chance to respond with the corresponding client flag. Signed-off-by: Eric Blake <ebl...@redhat.com> --- doc/proto.md | 17 ++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/doc/proto.md b/doc/proto.md index d0102e0..4

[Nbd] [PATCH 3/1] doc: Propose Structured Replies extension

2016-03-28 Thread Eric Blake
-by: Eric Blake <ebl...@redhat.com> --- doc/proto.md | 123 +++ 1 file changed, 123 insertions(+) diff --git a/doc/proto.md b/doc/proto.md index 44579fc..f687e3e 100644 --- a/doc/proto.md +++ b/doc/proto.md @@ -209,6 +209,10 @@ same value for

Re: [Nbd] [Qemu-devel] [PATCH 3/1] doc: Propose Structured Replies extension

2016-03-29 Thread Eric Blake
On 03/29/2016 12:19 PM, Wouter Verhelst wrote: > On Tue, Mar 29, 2016 at 12:07:59PM -0600, Eric Blake wrote: >> On 03/29/2016 12:03 PM, Wouter Verhelst wrote: >>> On Tue, Mar 29, 2016 at 11:45:45AM -0600, Eric Blake wrote: >>>> Supporting DF merely transfers the burde

Re: [Nbd] [PATCH 3/1] doc: Propose Structured Replies extension

2016-03-29 Thread Eric Blake
of the reply says whether the payload will be length 0 or not, but only new commands should get that treatment. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature -

Re: [Nbd] [Qemu-devel] [PATCH 3/1] doc: Propose Structured Replies extension

2016-03-29 Thread Eric Blake
On 03/29/2016 11:34 AM, Alex Bligh wrote: > > On 29 Mar 2016, at 16:12, Eric Blake <ebl...@redhat.com> wrote: >>> >>> More a way of guaranteeing avoiding a fragmentation on 'simple' reads. >>> Perhaps a 'DF' bit (don't fragment)! If the server doesn't like

Re: [Nbd] [Qemu-devel] [PATCH 3/1] doc: Propose Structured Replies extension

2016-03-29 Thread Eric Blake
On 03/29/2016 12:03 PM, Wouter Verhelst wrote: > On Tue, Mar 29, 2016 at 11:45:45AM -0600, Eric Blake wrote: >> On 03/29/2016 11:34 AM, Alex Bligh wrote: >>> I would agree. I think if it supports the structured reply semantics, >>> it should also support 'DF'. So if y

Re: [Nbd] [PATCH 3/1] doc: Propose Structured Replies extension

2016-03-29 Thread Eric Blake
On 03/29/2016 11:53 AM, Wouter Verhelst wrote: > Hi Eric, > > Having read this in more detail now: > > On Mon, Mar 28, 2016 at 09:56:36PM -0600, Eric Blake wrote: >> + The server MUST ensure that each read chunk lies within the original >> + offset and length of

Re: [Nbd] [PATCH] Strawman proposal for NBD structured replies

2016-03-29 Thread Eric Blake
> detailed information", or something along those lines. Except that offset 0 IS a valid location, and there is no unsigned number before 0 if the read error occurs while reading the head of the file. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library ht

[Nbd] [PATCH v2 2/3] doc: Mention proper use of handle

2016-03-29 Thread Eric Blake
the server is sending replies out of order. Make it clear that the client does not have to follow any particular order of handles, and can reuse values. Signed-off-by: Eric Blake <ebl...@redhat.com> --- doc/proto.md | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/prot

[Nbd] [PATCH v2 3/3] doc: Propose Structured Read extension

2016-03-29 Thread Eric Blake
they carry a data payload. This proposal does NOT permit structured replies to anything other than NBD_CMD_READ, although a future proposal may wish to make that valid (so that a server could be written that only returns structured replies). Signed-off-by: Eric Blake <ebl...@redhat.com> --

[Nbd] [PATCH v2 1/3] NBD proto: add "Command flags" section

2016-03-29 Thread Eric Blake
ed-off-by: Denis V. Lunev <d...@openvz.org> CC: Wouter Verhelst <w...@uter.be> CC: Alex Bligh <a...@alex.org.uk> Message-Id: <1459161798-32120-4-git-send-email-...@openvz.org> [rearrange subsections to parallel Handshake phase, add more details] Signed-off-by: Eric Blake <ebl.

[Nbd] [PATCH v2 0/3] NBD Structured Read

2016-03-29 Thread Eric Blake
with no offset). Eric Blake (2): doc: Mention proper use of handle doc: Propose Structured Read extension Pavel Borzenkov (1): NBD proto: add "Command flags" section doc/proto.md | 282 +-- 1 file changed, 277 insertions(+), 5

Re: [Nbd] [PATCHv2] Strawman proposal for NBD structured replies

2016-03-29 Thread Eric Blake
the command > +with `ETOOBIG` if the length read exceeds [65,536 bytes | the `ETOOBIG` is not a standard error; my v2 went with the POSIX EOVERFLOW and defined it to it's Linux value of 75. > + > +If more than one data chunk containing an error has been transmitted > +prior to send

Re: [Nbd] [Qemu-devel] [PATCH v2 3/3] doc: Propose Structured Read extension

2016-03-29 Thread Eric Blake
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 m

Re: [Nbd] [PATCH v3 4/5] doc: Propose STRUCTURED_REPLY extension

2016-03-31 Thread Eric Blake
t will also affect a v4, and we're still waiting for Markus to get back and have a chance to chime in, so this patch is not quite ready for inclusion yet, but I'm liking the progress we've made. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.o

Re: [Nbd] [PATCH v3 4/5] doc: Propose STRUCTURED_REPLY extension

2016-03-31 Thread Eric Blake
On 03/31/2016 05:23 AM, Alex Bligh wrote: > Eric, > > We're getting there! I'm only going to comment on this one rather than > the 'final form' patch, so we get this one right to start off with. Agreed. > > On 31 Mar 2016, at 07:06, Eric Blake <ebl...@redhat.com> wr

Re: [Nbd] [PATCH v2 1/1] NBD proto: add WRITE_ZEROES extension

2016-03-31 Thread Eric Blake
less efficient; so having the default state of the flag geared towards efficiency (both in the sense that punching holes can be faster than writing zeroes, and that most people LIKE the storage savings of sparse files). > I suspect there are already some backends (e.g. ceph on qemu-nbd) which >

  1   2   3   >