From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1al2fT-0006mP-4j for qemu-devel@nongnu.org; Tue, 29 Mar 2016 19:03:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1al2fO-0006Pr-SA for qemu-devel@nongnu.org; Tue, 29 Mar 2016 19:03:21 -0400 Received: from resqmta-po-01v.sys.comcast.net ([96.114.154.160]:53279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1al2fO-0006Pa-NP for qemu-devel@nongnu.org; Tue, 29 Mar 2016 19:03:18 -0400 From: Eric Blake Date: Tue, 29 Mar 2016 17:00:59 -0600 Message-Id: <1459292460-6875-3-git-send-email-eblake@redhat.com> In-Reply-To: <1459292460-6875-1-git-send-email-eblake@redhat.com> References: <1459173555-4890-1-git-send-email-eblake@redhat.com> <1459292460-6875-1-git-send-email-eblake@redhat.com> Subject: [Qemu-devel] [PATCH v2 2/3] doc: Mention proper use of handle List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: nbd-general@lists.sourceforge.net Cc: w@uter.be, qemu-devel@nongnu.org, alex@alex.org.uk Although the proper use of the handle field during transmission phase was implied, it never hurts to make it more explicit that clients should use distinct handles for multiple in-flight requests. Likewise, the server must repeat the handle unchanged, in order for the client to track when 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 --- doc/proto.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/proto.md b/doc/proto.md index 3d49162..3f9ee23 100644 --- a/doc/proto.md +++ b/doc/proto.md @@ -203,7 +203,13 @@ S: 64 bits, handle S: (*length* bytes of data if the request is of type `NBD_CMD_READ`) Replies need not be sent in the same order as requests (i.e., requests -may be handled by the server asynchronously). +may be handled by the server asynchronously). Clients SHOULD use a +handle that is distinct from all other currently pending transactions, +but MAY reuse handles that are no longer in flight; handles need not +be consecutive. In each reply, the server MUST use the same value for +handle as was sent by the client in the corresponding request. In +this way, the client can correlate which request is receiving a +response. ## Values -- 2.5.5