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

2016-04-19 Thread Eric Blake
ll documented under the extension section. So at this point, we're still debating on how best to place the text within the document for promotion to normative, while at the same time also trying to adjust structured replies to make error replies easier to identify. -- Eric Blake ebla

[Nbd] [PATCH v2 0/2] extension-structured-reply layout cleanup, consistent error reply types

2016-04-19 Thread Eric Blake
Split into two parts, to make the value changes distinct from the document reorganization Eric Blake (2): doc: Move sections about structured reply values doc: In STRUCTURED_REPLY, make error types easy to recognize doc/proto.md | 234

[Nbd] [PATCH v2 1/2] doc: Move sections about structured reply values

2016-04-19 Thread Eric Blake
, tweak a couple of wording issues outside of the section shuffling. Signed-off-by: Eric Blake --- doc/proto.md | 219 +-- 1 file changed, 109 insertions(+), 110 deletions(-) diff --git a/doc/proto.md b/doc/proto.md index 29ef281..e484055

[Nbd] [PATCH v2 2/2] doc: In STRUCTURED_REPLY, make error types easy to recognize

2016-04-19 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 --- doc/proto.md | 93 +++- 1 file ch

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

2016-04-20 Thread Eric Blake
t's how it was before, and you seem to have reordered (not > sure why). Because of our earlier conversation on the same topic: https://sourceforge.net/p/nbd/mailman/nbd-general/thread/20160409104438.GP19023%40grep.be/#msg35003527 -- Eric Blake eblake redhat com+1-919-301-3266 L

Re: [Nbd] [PATCH v2 1/2] doc: Move sections about structured reply values

2016-04-20 Thread Eric Blake
applies to the "magic 0x67446698" but NOT to the "bytes MAY be invalid if an error", because there is no text above that states the bytes may be invalid until the next paragraph). -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://l

[Nbd] question on ioctl NBD_SET_FLAGS

2016-04-20 Thread Eric Blake
we think that it is unlikely enough to worry about, where by the time there are more than 16 transmission flags, users are likely to already be using new-enough qemu that doesn't send global flags to the kernel? -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt

Re: [Nbd] [PATCH/RFC] Synchronize the option haggling phase

2016-04-21 Thread Eric Blake
On 04/21/2016 04:31 AM, Alex Bligh wrote: > > On 20 Apr 2016, at 16:48, Wouter Verhelst wrote: > >> On Mon, Apr 18, 2016 at 01:49:45PM -0600, Eric Blake wrote: >>> plus simplifications to NBD_OPT_GO: >>> >>> diff --git i/doc/proto.md w/doc/proto.md &

Re: [Nbd] New web site?

2016-04-21 Thread Eric Blake
run by FSF) is available, but it does a lot better at spam management. Also, qemu recently aligned with the Software Freedom Conservancy https://lists.gnu.org/archive/html/qemu-devel/2015-07/msg04802.html and as such may have advice on how to migrate canonical management of a project. Since qemu is one

[Nbd] [PATCH] doc: Cleanups now that we have synchronous haggling

2016-04-21 Thread Eric Blake
Now that there is at most one in-flight message, we can drop some other statements about the server needing to wait to process one option while other options are in-flight. Signed-off-by: Eric Blake --- master branch doc/proto.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff

[Nbd] [PATCH] doc: Cleanup to info extension thanks to synchronous haggling

2016-04-21 Thread Eric Blake
Now that we require at most one in-flight option request, we can simplify the wording related to handling of NBD_OPT_GO replies. Signed-off-by: Eric Blake --- extension-info branch doc/proto.md | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/doc/proto.md b/doc

Re: [Nbd] [PATCH] doc: Cleanup to info extension thanks to synchronous haggling

2016-04-22 Thread Eric Blake
On 04/21/2016 09:49 PM, Alex Bligh wrote: > Eric, > > On 21 Apr 2016, at 20:12, Eric Blake wrote: > >> Now that we require at most one in-flight option request, we >> can simplify the wording related to handling of NBD_OPT_GO >> replies. > > This l

[Nbd] [PATCH v3 00/44] NBD protocol additions

2016-04-22 Thread Eric Blake
utdown requests' 037/44:[down] 'nbd: Create struct for tracking export info' 038/44:[down] 'block: Add blk_get_opt_transfer_length()' 039/44:[0065] [FC] 'nbd: Implement NBD_OPT_GO on server' 040/44:[0139] [FC] 'nbd: Implement NBD_OPT_GO on client' 041/4

Re: [Nbd] Thoughts re INFO/BLOCKSIZE

2016-04-25 Thread Eric Blake
tion, just > say that if it's provided inband that takes priority. > > Thoughts? It seems reasonable to me. Should one of us propose a followup patch to the extension-info branch with the simplification? -- Eric Blake eblake redhat com+1-919-301-3266 Libvi

Re: [Nbd] Thoughts on structured replies

2016-04-25 Thread Eric Blake
BLOCKSIZE stuff? > I don't think so, because the ability to read holes is the main reason I added chunking of the read reply. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature --

Re: [Nbd] [PATCH/RFC] Remove NBD_OPT_BLOCK_SIZE

2016-04-25 Thread Eric Blake
n the "Block Sizes" section as a justification for why a server might want to advertise non-default sizes, if we get rid of the mention here. Otherwise, I like where this is headed in terms of simplification, and it's only a few minor tweaks to my existing qemu patches to update to the c

Re: [Nbd] [PATCH/RFCv3] Remove NBD_OPT_BLOCK_SIZE; add specific requests to NBD_OPT_INFO

2016-04-26 Thread Eric Blake
d on constraints on their values. The server MUST send this info if > + it intends to enforce block sizes other than the defaults. After > + sending this information, the server can legitimately assume that > + any client that co

Re: [Nbd] [PATCH/RFCv4] Remove NBD_OPT_BLOCK_SIZE; add specific requests to NBD_OPT_INFO

2016-04-26 Thread Eric Blake
PORT in its request list (since that one is mandatory even without being requested)? On the other hand, I don't see what it would add other than verbosity. Looking better, and I'm still feeling comfortable with the amount of tweaks to my qemu patches to implement this change if we go wi

Re: [Nbd] [PATCHv6] Remove NBD_OPT_BLOCK_SIZE; add specific requests to NBD_OPT_INFO

2016-04-28 Thread Eric Blake
assumption cannot be made solely on the basis of an `NBD_OPT_INFO` > + with an `NBD_INFO_BLOCK_SIZE` request). s/request)/request, nor if the client did not request `NBD_INFO_BLOCK_SIZE`)/ > The *length* MUST be 14, > + and the reply payload is interpreted as: > >

Re: [Nbd] [PATCHv6] Remove NBD_OPT_BLOCK_SIZE; add specific requests to NBD_OPT_INFO

2016-04-28 Thread Eric Blake
n its next request for NBD_OPT_GO or to give up now. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature -- Find and fi

[Nbd] [PATCH] doc: Restore a lost sentence about NBD_REP_ERR_BLOCK_SIZE_REQD

2016-04-28 Thread Eric Blake
igned-off-by: Eric Blake --- extension-info branch doc/proto.md | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/proto.md b/doc/proto.md index 1a0f1cf..da65df0 100644 --- a/doc/proto.md +++ b/doc/proto.md @@ -949,12 +949,13 @@ of the newstyle negoti

Re: [Nbd] [PATCHv6] Remove NBD_OPT_BLOCK_SIZE; add specific requests to NBD_OPT_INFO

2016-04-29 Thread Eric Blake
off (the server will happen to honor the request, rather than disconnect or fail with the suggested EINVAL, but the client was out-of-spec so it shouldn't be relying on any particular server behavior, whether success or a particular error). Let me know if any of the above reasoning is wrong, or

Re: [Nbd] [PATCHv6] Remove NBD_OPT_BLOCK_SIZE; add specific requests to NBD_OPT_INFO

2016-04-29 Thread Eric Blake
choice of preferred block size isn't as much of a sticking point as the choice of the minimum block size. And a choice of whether to use O_DIRECT might also be, to some extent, and out-of-band configuration. At any rate, I'm glad we agree that my reading of the spec vs. planned implementatio

Re: [Nbd] [Qemu-devel] Is NBD_CMD_FLAG_FUA valid during NBD_CMD_FLUSH?

2016-05-02 Thread Eric Blake
On 03/31/2016 02:34 PM, Eric Blake wrote: > On 03/31/2016 02:17 PM, Alex Bligh wrote: >> OK so I actually went and researched what my answer was last time I >> was asked ( :-) ): >> >> Here was my conclusion last time after trawling through lkml >>

Re: [Nbd] [PATCH] Fix flags processing to avoid bogus read-only export

2016-05-04 Thread Eric Blake
wn the road. But not worth rewriting the commit message for that. > > Signed-off-by: Alex Bligh > --- > nbd-client.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Eric Blake > > diff --git a/nbd-client.c b/nbd-client.c > index cc9a06e..ddc849c 100

Re: [Nbd] [PATCHv5 1/7] Add GnuTLS infrastructure

2016-05-05 Thread Eric Blake
optional, but if present they represent 8 spaces. Many GNU projects use a space-only policy (GNU coreutils for example). So if I have any say, I'd recommend that you re-tune your indent settings for space-only on any file that you reindent to keep in the GNU style. -- Eric Blak

Re: [Nbd] [Qemu-devel] [PATCH] nbd: fix trim/discard commands with a length bigger than NBD_MAX_BUFFER_SIZE

2016-05-10 Thread Eric Blake
the NBD protocol before taking anything into qemu. We've got time on our hand, so let's use it to get this right. (That, and I have several pending patches that conflict with this as part of adding WRITE_ZEROES and INFO_BLOCK_SIZE support, where it may be easier to resubmit this

Re: [Nbd] [Qemu-devel] [PATCH] nbd: fix trim/discard commands with a length bigger than NBD_MAX_BUFFER_SIZE

2016-05-10 Thread Eric Blake
qemu is free to do how it wishes. Okay, sounds like that part is uncontroversial, and it is indeed worth improving qemu's behavior. > > What surprises me is that a release kernel is using experimental > NBD extensions; there's no guarantee these won't change. Or does >

Re: [Nbd] [Qemu-devel] [PATCH] nbd: fix trim/discard commands with a length bigger than NBD_MAX_BUFFER_SIZE

2016-05-10 Thread Eric Blake
On 05/10/2016 09:41 AM, Alex Bligh wrote: > > On 10 May 2016, at 16:29, Eric Blake wrote: > >> So the kernel is currently one of the clients that does NOT honor block >> sizes, and as such, servers should be prepared for ANY size up to >> UINT_MAX (other than DoS

Re: [Nbd] [Qemu-devel] [PATCH] nbd: fix trim/discard commands with a length bigger than NBD_MAX_BUFFER_SIZE

2016-05-10 Thread Eric Blake
n("/dev/nbd1", O_RDWR) = 3 fallocate(3, FALLOC_FL_KEEP_SIZE|FALLOC_FL_PUNCH_HOLE, 0, 65536) = -1 ENODEV (No such device) The ENODEV is a rather unusual choice of error. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org si

Re: [Nbd] Fwd: [PATCH v4 02/18] nbd: fix checkpatch trailing space warning.

2016-05-11 Thread Eric Blake
series. The cover letter is a great place to point out how v4 differs from v3, but also to point out which patches are unchanged from v3, to save reviewer's time. So if all you did was add new patches, a cover-letter mention of which patches remain unchanged might be helpful. -- Eric Blake

Re: [Nbd] [Qemu-devel] [PATCH] nbd: fix trim/discard commands with a length bigger than NBD_MAX_BUFFER_SIZE

2016-05-11 Thread Eric Blake
(if requested by client and replied by server, then this can be larger than the normal maximum size in NBD_INFO_BLOCK_SIZE; if either side doesn't request the info, then assume any maximum in NBD_INFO_BLOCK_SIZE applies, otherwise UINT32_MAX; and the two infos are separate items because

[Nbd] [PATCH] doc: Document maximum message length during option haggling

2016-05-11 Thread Eric Blake
field (although then we'd have to be careful about whether an NBD_REP message could have different flags than those requested by the client). Signed-off-by: Eric Blake --- doc/proto.md | 28 +--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/doc/prot

Re: [Nbd] [PATCH] doc: Document maximum message length during option haggling

2016-05-11 Thread Eric Blake
message sizes (one for options, the other for transmission). -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature ---

[Nbd] [PATCH] doc: Clarify maximum size limits

2016-05-11 Thread Eric Blake
only actually trim a subset of the client request), CMD_WRITE_ZEROES must write actual zeroes over the entire request (but if it can punch holes, only a subset of the client request need result in holes). Signed-off-by: Eric Blake --- For the extension-info branch, and builds on the earlier patch

Re: [Nbd] [PATCH] doc: Document maximum message length during option haggling

2016-05-11 Thread Eric Blake
On 05/11/2016 02:20 PM, Alex Bligh wrote: > > On 11 May 2016, at 20:08, Eric Blake wrote: > >> Calling out a MUCH smaller limit of 16k during handshake phase in >> contrast to transmission phase, and acknowledging that we have bytes in >> transmission phase that wi

Re: [Nbd] [Qemu-devel] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Eric Blake
to make this interoperability point obvious. > > To test qemu against nbdkit you can do this in the nbdkit sources: > > make > make check TESTS=test-newstyle \ > LIBGUESTFS_HV=/path/to/qemu/x86_64-softmmu/qemu-system-x86_64 \ >

Re: [Nbd] [Qemu-devel] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Eric Blake
ability point obvious. > > I can't actually see the issue here. It explains what needs to be > implemented by the server, and that includes NBD_OPT_LIST. Very > happy to add some clarity, but I'm not sure where it'

Re: [Nbd] [Qemu-devel] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Eric Blake
On 05/17/2016 09:52 AM, Eric Blake wrote: >>> Perhaps nbdkit should implement NBD_OPT_LIST returning just "" (the >>> default name) as its only list entry? >> >> Or "default". > > As I read the protocol, I don't see "default"

Re: [Nbd] [Qemu-devel] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Eric Blake
On 05/17/2016 09:58 AM, Richard W.M. Jones wrote: > On Tue, May 17, 2016 at 09:52:30AM -0600, Eric Blake wrote: >> so it might be nicer to >> make a change to the protocol document that instead permits current >> nbdkit behavior and puts the burden on clients to interoperate

Re: [Nbd] [Qemu-devel] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Eric Blake
n NBD_REP_SERVER with name ""; >> or an explicit statement that if a server rejects NBD_OPT_LIST, then the >> client SHOULD assume that any name will work for >> NBD_OPT_EXPORT_NAME/NBD_OPT_GO. > > I think it's sim

Re: [Nbd] [Qemu-devel] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Eric Blake
On 05/17/2016 10:41 AM, Richard W.M. Jones wrote: > On Tue, May 17, 2016 at 10:05:50AM -0600, Eric Blake wrote: >> On 05/17/2016 09:58 AM, Richard W.M. Jones wrote: >>> On Tue, May 17, 2016 at 09:52:30AM -0600, Eric Blake wrote: >>>> so it might be nicer to >

Re: [Nbd] [Qemu-devel] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Eric Blake
On 05/17/2016 10:39 AM, Richard W.M. Jones wrote: > On Tue, May 17, 2016 at 09:59:02AM -0600, Eric Blake wrote: >> On 05/17/2016 09:52 AM, Eric Blake wrote: >>>>> Perhaps nbdkit should implement NBD_OPT_LIST returning just "" (the >>>>> default na

Re: [Nbd] [Qemu-devel] [PULL 23/28] nbd: always query export list in fixed new style protocol

2016-05-17 Thread Eric Blake
itrary name, but even then, there is no guarantee that the qemu client is using the "" default name, and since NBD_OPT_EXPORT_NAME doesn't care, I think it's nicer to state that NBD_OPT_LIST should O

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
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 > > [mpa: Keep the blockdevice open until all users left] > Signed-off-by: Markus Parg

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

2016-06-24 Thread Eric Blake
; Signed-off-by: Pranay Kr. Srivastava > --- > drivers/block/nbd.c | 124 > ++++---- > 1 file changed, 96 insertions(+), 28 deletions(-) > -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtuali

Re: [Nbd] [PATCH v4 14/14] nbd: Implement NBD_CMD_WRITE_ZEROES on client

2016-06-27 Thread Eric Blake
On 06/27/2016 06:13 AM, Paolo Bonzini wrote: > > > On 26/06/2016 00:15, Eric Blake wrote: >> diff --git a/block/nbd.c b/block/nbd.c >> index 8d57220..049d1bd 100644 >> --- a/block/nbd.c >> +++ b/block/nbd.c >> @@ -357,6 +357,7 @@ static int nbd_co_flus

Re: [Nbd] [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server

2016-07-19 Thread Eric Blake
[adding nbd list] On 07/19/2016 12:21 AM, Fam Zheng wrote: > On Mon, 07/18 22:08, Eric Blake wrote: >> Upstream NBD protocol recently added the ability to efficiently >> write zeroes without having to send the zeroes over the wire, >> along with a flag to control whether th

Re: [Nbd] [Qemu-devel] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server

2016-07-19 Thread Eric Blake
On 07/19/2016 09:34 PM, Fam Zheng wrote: > On Tue, 07/19 17:45, Paolo Bonzini wrote: >> >> >> On 19/07/2016 17:28, Eric Blake wrote: >>>> If I'm reading the NBD proto.md correctly, this is not enough if >>>> NBD_CMD_FLAG_NO_HOLE is specified.

Re: [Nbd] [RESEND][PATCH 0/5] nbd improvements

2016-09-15 Thread Eric Blake
On 09/15/2016 06:09 AM, Alex Bligh wrote: > > I also wonder whether any servers that can do caching per > connection will always share a consistent cache between > connections. The one I'm worried about in particular here > is qemu-nbd - Eric Blake CC'd. > I doubt t

Re: [Nbd] [RESEND][PATCH 0/5] nbd improvements

2016-09-15 Thread Eric Blake
ation >> stage (it would only be one flag, e.g. 'multiple connections >> unsafe'). > > I suppose that's not a bad idea. Seems like it may need to be a per-export flag, rather than a global flag (as a given server may be able to serve multiple types of files, where t

Re: [Nbd] write_zeroes/trim on the whole disk

2016-09-23 Thread Eric Blake
ron out the details of the documentation before making it a formal part of the spec. It's important to remember that such a proposal should still be optional (a server need not implement the new mode, and a client should be prepared to fall back to other means if the server does not suppo

Re: [Nbd] [PATCH] proto: add 'shift' extension.

2016-09-26 Thread Eric Blake
sly requested via NBD_CMD_FLAG_SHIFT, rather than having ALL information it needs immediately available in the current NBD_CMD_WRITE_ZEROES). I'd much rather support a single flag that says to zero the entire disk than to introduce stateful variable-amount shifting. -- Eric Blake

Re: [Nbd] [PATCH] proto: add 'shift' extension.

2016-09-26 Thread Eric Blake
ething that the client can change at-will during a live session, may be useful. Or it may be the source of arithmetic overflow exploits in poor implementations, or of denial-of-service with used with a READ or WRITE to send more than 2G of data in a single command. In other words, I don't y

[Nbd] build failure

2016-10-13 Thread Eric Blake
vised to start using 'subdir-objects' option throughout your automake: project, to avoid future incompatibilities. autoreconf: automake failed with exit status: 1 I ran out of time to try and patch it today, if you want to beat me to it. -- Eric Blake eblake redhat com+1-919-301-3

Re: [Nbd] TLS implementation in reference nbd-server

2016-10-13 Thread Eric Blake
} send_reply(client, opt, NBD_REP_ERR_UNSUP, -1, "The given option is unknown to this server implementation"); break; } -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org sig

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

2016-10-14 Thread Eric Blake
ch as me posting this email just as a heads-up in case anyone else hits the problem (I just hit it in qemu while trying to add ESHUTDOWN support). -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualizat

Re: [Nbd] TLS implementation in reference nbd-server

2016-10-14 Thread Eric Blake
ging away at the autoreconf failure on my end. This was just the quick PoC to get the conversation going, pointing out that you made a common mistake (since I've already fixed the same bug in both qemu and nbdkit); and that it is the same mistake that NBD_FLAG_FIXED_NEWSTYLE is supposed to adver

Re: [Nbd] build failure

2016-10-14 Thread Eric Blake
On 10/14/2016 01:32 PM, Wouter Verhelst wrote: > On Thu, Oct 13, 2016 at 05:33:18PM -0500, Eric Blake wrote: >> I'm getting this failure when trying to build NBD, as part of >> 'autoreconf -vfi': >> >> configure.ac:248: error: required file 'system

Re: [Nbd] TLS implementation in reference nbd-server

2016-10-14 Thread Eric Blake
On 10/14/2016 02:23 PM, Eric Blake wrote: >> static void socket_read(CLIENT* client, void *buf, size_t len) { >> +void *tmp = NULL; >> +if (!buf) { >> +/* FIXME: Enforce maximum bound on client-provided len? */ >> +

[Nbd] [PATCH] build: Silence autogen.sh warnings

2016-10-14 Thread Eric Blake
omake: of the corresponding sources. automake: You are advised to start using 'subdir-objects' option throughout your automake: project, to avoid future incompatibilities. Following the advice doesn't break anything, so let's do it. I also noticed that the build leaves behind an

[Nbd] [PATCH] server: Read client's length data before next option

2016-10-14 Thread Eric Blake
y for so long is that it has taken us this long to finally want to implement clients that use a new option. Signed-off-by: Eric Blake --- Perhaps you want to split this into two patches, one adding consume_len() and fixing the default case that responds with NBD_REP_ERR_UNSUP (with inte

Re: [Nbd] [PATCH] server: Read client's length data before next option

2016-10-14 Thread Eric Blake
On 10/14/2016 04:02 PM, Eric Blake wrote: > Any client attempting to probe support for a new option, such as > NBD_OPT_STARTTLS or NBD_OPT_GO, with plans to do a graceful > fallback to older methods, will fail in its attempt if the server > does not ignore the length field and potentia

Re: [Nbd] [PATCH] server: Read client's length data before next option

2016-10-14 Thread Eric Blake
On 10/14/2016 04:02 PM, Eric Blake wrote: > /** > * Consume data from a socket that we don't want > * > - * @param f a file descriptor > + * @param c the client data stream > * @param buf a buffer > * @param len the number of bytes to consume > * @param

Re: [Nbd] TLS implementation in reference nbd-server

2016-10-14 Thread Eric Blake
=/path/to/qemutls --tls-creds tls0 --exportname default where /path/to/qemutls contains the necessary certificate files. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital signature --

Re: [Nbd] build failure

2016-10-17 Thread Eric Blake
On 10/15/2016 01:46 PM, Wouter Verhelst wrote: > On Fri, Oct 14, 2016 at 03:11:55PM -0500, Eric Blake wrote: >> On 10/14/2016 01:32 PM, Wouter Verhelst wrote: >>> On Thu, Oct 13, 2016 at 05:33:18PM -0500, Eric Blake wrote: >>>> I'm getting this failure w

Re: [Nbd] [PATCH] build: Silence autogen.sh warnings

2016-10-17 Thread Eric Blake
On 10/14/2016 03:19 PM, Eric Blake wrote: > Starting from a fresh git checkout, running ./autogen.sh gives a > couple of warnings on my Fedora 24 build tools, one from libtool: > > libtoolize: Consider adding '-I support' to ACLOCAL_AMFLAGS in Makefile.am. > > and o

[Nbd] [PATCH v2 0/6] build and server bug fixes

2016-10-17 Thread Eric Blake
v2 of a couple of patches I've posted in the last week, now rolled into one series, fixing a bug triggered by automake 1.15, and adding testsuite coverage (which in turn exposed another recent buggy commit). Eric Blake (6): build: Silence autogen.sh warnings server: Fix botched s

[Nbd] [PATCH v2 6/6] server: Read client's TLS length data before next option

2016-10-17 Thread Eric Blake
ients. Furthermore, even if the server requires TLS, and rejects all but NBD_OPT_STARTTLS as the first valid option, it should still honor NBD_OPT_ABORT. Signed-off-by: Eric Blake --- nbd-server.c | 8 1 file changed, 8 insertions(+) diff --git a/nbd-server.c b/nbd-server.c index 4b0692d..d5b2013 1

[Nbd] [PATCH v2 4/6] server: Read client's unknown option length before next option

2016-10-17 Thread Eric Blake
ff-by: Eric Blake --- nbd-server.c | 16 1 file changed, 16 insertions(+) diff --git a/nbd-server.c b/nbd-server.c index c93a9d8..4b0692d 100644 --- a/nbd-server.c +++ b/nbd-server.c @@ -373,6 +373,21 @@ static inline void consume(CLIENT* c, size_t len, void * buf, size_t b

[Nbd] [PATCH v2 2/6] server: Fix botched strlen computation of error message

2016-10-17 Thread Eric Blake
Commit 3b80382 tried to make it easy for the server to send an error message whose length was determined by strlen(), but ended up sending a length of UINT32_MAX, causing clients to either hang up (reply too large) or wait for nearly 4G of data that was never coming. Signed-off-by: Eric Blake

[Nbd] [PATCH v2 1/6] build: Silence autogen.sh warnings

2016-10-17 Thread Eric Blake
nstead open-code the traversal to the desired files. I also noticed that the build was already leaving behind an untracked manpage.log file, in addition to the new .dirstamp witness file created by our new use of subdir-objects. Signed-off-by: Eric Blake --- .gitignore| 2 ++ Makefile.

[Nbd] [PATCH v2 3/6] server: Swap argument order in consume()

2016-10-17 Thread Eric Blake
The signature of consume() threw me off. Good design says that if you are going to have paired parameters (buf and bufsize), you generally want them adjacent, not separated by an unrelated parameter (len). Move len to be first, adjusting all callers. Signed-off-by: Eric Blake --- nbd-server.c

[Nbd] [PATCH v2 5/6] nbd: Test recent bug fixes

2016-10-17 Thread Eric Blake
unknown command. Signed-off-by: Eric Blake --- tests/run/nbd-tester-client.c | 47 +++ 1 file changed, 47 insertions(+) diff --git a/tests/run/nbd-tester-client.c b/tests/run/nbd-tester-client.c index 28db8ee..099bec1 100644 --- a/tests/run/nbd-tester-client.c

Re: [Nbd] [PATCH v2 1/6] build: Silence autogen.sh warnings

2016-10-18 Thread Eric Blake
ry-picked two commits from Josef > to allow building on CentOS 6, would be silly if we lose that again...) And that will be part of my testing. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization

Re: [Nbd] [PATCH v2 1/6] build: Silence autogen.sh warnings

2016-10-18 Thread Eric Blake
On 10/18/2016 09:12 AM, Eric Blake wrote: > On 10/18/2016 06:01 AM, Wouter Verhelst wrote: > >>> Following the advice almost works, except that automake 1.15 still >>> has a nasty bug (https://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928) >>> where use of $(foo) in

Re: [Nbd] [PATCH v2 1/6] build: Silence autogen.sh warnings

2016-10-18 Thread Eric Blake
o allow building on CentOS 6, would be silly if we lose that again...) I'll make sure it works before sending v3 of this patch. However, the other patches in this series should still be usable as-is without this one going in. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt v

[Nbd] [PATCH v3 2/2] build: Silence autogen.sh warnings

2016-10-19 Thread Eric Blake
new use of subdir-objects. This patch has been tested with 'make distcheck' across multiple automake and libtool versions, ranging from CentOS 6 vintage to current git toolchains. Signed-off-by: Eric Blake --- .gitignore| 2 ++ Makefile.am | 1 + configure.ac

[Nbd] [PATCH v3 0/2] silence build warnings

2016-10-19 Thread Eric Blake
These two patches replace 1/6 in my previous posting, while 2-6 of that series remain identical (and can even be applied independently prior to this respin, other than the review comment on 5/6 that still needs addressing). Eric Blake (2): build: Distribute netdb-compat.h without relying on

[Nbd] [PATCH v3 1/2] build: Distribute netdb-compat.h without relying on tests

2016-10-19 Thread Eric Blake
nbd-server depends on netdb-compat.h; however, we were only including it in the tarball as a side effect of it also being used by the testsuite. Make the dependency explicit. Signed-off-by: Eric Blake --- Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a

Re: [Nbd] [PATCH v2 5/6] nbd: Test recent bug fixes

2016-10-19 Thread Eric Blake
On 10/18/2016 06:07 AM, Wouter Verhelst wrote: > On Mon, Oct 17, 2016 at 03:23:39PM -0500, Eric Blake wrote: >> Add a test of intentionally provoking a server error during option >> negotiation to prove that a client can still fall back to known >> options; thus covering two r

[Nbd] ideal emacs settings?

2016-10-19 Thread Eric Blake
dd it within a .dir-locals.el file to make it apply to fresh git checkouts? -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Description: OpenPGP digital sign

[Nbd] [PATCH v3 5/6] tests: Cover recent bug fixes

2016-10-19 Thread Eric Blake
er sending the wrong length in an error reply, and for a server not reading enough data when replying to an unknown command. Signed-off-by: Eric Blake --- As requested by Wouter, split this off into an independent test, rather than impacting the startup of all other tests. tests/run/M

Re: [Nbd] ideal emacs settings?

2016-10-20 Thread Eric Blake
On 10/20/2016 02:38 AM, Wouter Verhelst wrote: > On Wed, Oct 19, 2016 at 05:07:11PM -0500, Eric Blake wrote: >> I noticed that nbd source code prefers the use of hard tab instead of >> spaces for indentation, and emacs does not play nicely with that by >> default. Does anyone

Re: [Nbd] ideal emacs settings?

2016-10-20 Thread Eric Blake
On 10/20/2016 03:55 AM, Alex Bligh wrote: > >> On 19 Oct 2016, at 23:07, Eric Blake wrote: >> >> I noticed that nbd source code prefers the use of hard tab instead of >> spaces for indentation, and emacs does not play nicely with that by >> default.

[Nbd] [PATCH] maint: Let emacs know our preferred style

2016-10-20 Thread Eric Blake
-off-by: Eric Blake --- .dir-locals.el | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .dir-locals.el diff --git a/.dir-locals.el b/.dir-locals.el new file mode 100644 index 000..046e004 --- /dev/null +++ b/.dir-locals.el @@ -0,0 +1,2 @@ +((c-mode . ((c-file-style . "

Re: [Nbd] [PATCH v2 5/6] nbd: Test recent bug fixes

2016-10-20 Thread Eric Blake
h) to it? That enum was meant as that "framework" ;-) > my v3 changed the TEST_ enum instead, but I'll see if I can redo it to trigger off of a CONNECTION_TYPE_ value. -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization libr

[Nbd] [PATCH] build: Ignore copied file during in-tree build

2016-10-20 Thread Eric Blake
Commit b885246 creates a symlink to work around an automake weakness, but forgot to ignore the link when doing an in-tree build. Signed-off-by: Eric Blake --- Hmm. I guess I was so busy testing VPATH builds that I forgot to do one final test of an in-tree build :) .gitignore | 1 + 1 file

Re: [Nbd] [PATCH] nbd: use dev_err_ratelimited in io path

2016-12-05 Thread Eric Blake
Signed-off-by: Josef Bacik > --- > drivers/block/nbd.c | 23 --- > 1 file changed, 12 insertions(+), 11 deletions(-) > -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvirt.org signature.asc Descri

[Nbd] [PATCH] doc: Propose NBD_FLAG_INIT_ZEROES extension

2016-12-05 Thread Eric Blake
While not directly related to NBD_CMD_WRITE_ZEROES, the qemu team discovered that it is useful if a server can advertise whether an export is in a known-all-zeroes state at the time the client connects. Signed-off-by: Eric Blake --- doc/proto.md | 5 + 1 file changed, 5 insertions(+) This

Re: [Nbd] [Qemu-block] [PATCH] doc: Propose NBD_FLAG_INIT_ZEROES extension

2016-12-06 Thread Eric Blake
On 12/06/2016 03:25 AM, Kevin Wolf wrote: > Am 06.12.2016 um 00:42 hat Eric Blake geschrieben: >> While not directly related to NBD_CMD_WRITE_ZEROES, the qemu >> team discovered that it is useful if a server can advertise >> whether an export is in a known-all-zeroes sta

Re: [Nbd] [Qemu-block] [PATCH] doc: Propose NBD_FLAG_INIT_ZEROES extension

2016-12-07 Thread Eric Blake
ly tell the server to advertise the bit because the >> user has side knowledge that the file was just created (and then the >> burden of misbehavior is on the user if they mistakenly request the >> advertisement when it is not true). > > Maybe that's the only practical app

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

2016-12-08 Thread Eric Blake
;> clarifies what a client should do with that information if it gets it >> (i.e., "don't read it, it doesn't contain anything interesting"). > > That's fair enough until the last bit in brackets. Rather than saying > a client SHOULD NOT read it, it should s

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

2016-12-12 Thread Eric Blake
read as > +all zeroes; if clear, the block contents are not known. Note > +that the use of `NBD_CMD_WRITE_ZEROES` is related to this > +status, but that the server MAY report zeroes even where write > +zeroes has not been requ

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

2016-12-12 Thread Eric Blake
e inter-branch diff is indeed the best way to review the current state of the changes in relation to the master branch, rather than trying to follow one patch at a time. I'm grateful that you've stepped in to try and nail down some of the wordings, and doing a qemu proof-of-concept implementation

Re: [Nbd] [Qemu-devel] [Qemu-block] [PATCH] doc: Propose NBD_FLAG_INIT_ZEROES extension

2016-12-13 Thread Eric Blake
in the (16-bit) "transmission flags" field, where space is > at a premium. No, it is NOT a "transmission flag", as it is a per-export property (where we currently have 64 bits). -- Eric Blake e

Re: [Nbd] [Qemu-devel] [Qemu-block] [PATCH] doc: Propose NBD_FLAG_INIT_ZEROES extension

2016-12-14 Thread Eric Blake
On 12/14/2016 02:22 AM, Wouter Verhelst wrote: > Hi Eric, > > On Tue, Dec 13, 2016 at 04:36:08PM -0600, Eric Blake wrote: >> On 12/13/2016 06:18 AM, Wouter Verhelst wrote: >>> On Tue, Dec 13, 2016 at 08:38:12AM +0100, Kevin Wolf wrote: >>>> Am 12.12.2016 um 1

Re: [Nbd] [Qemu-devel] [PATCH] Further tidy-up on block status

2016-12-14 Thread Eric Blake
other than colons, > +and be non-empty. The entire name (namespace, colon and leaf-name) > +MUST NOT exceed 255 bytes (and therefore botht he namespace and s/botht he/both the/ -- Eric Blake eblake redhat com+1-919-301-3266 Libvirt virtualization library http://libvi

Re: [Nbd] Proposal to merge WRITE_ZEROES extension into master

2016-12-14 Thread Eric Blake
er. Admittedly > I didn't have a 'real' client to test it against. It's working well in qemu 2.8 without needing tweaks to the documentation. Should we try and do some cross-implementation testing today, before doing the actual merge? -- Eric Blake eblake redhat com

<    1   2   3   4   >