[Top][All Lists]

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

Re: [Qemu-block] [PATCH 03/18] nbd: Minimal structured read for server

From: Vladimir Sementsov-Ogievskiy
Subject: Re: [Qemu-block] [PATCH 03/18] nbd: Minimal structured read for server
Date: Thu, 4 May 2017 13:58:45 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0

07.02.2017 02:01, Eric Blake wrote:
On 02/03/2017 09:47 AM, Vladimir Sementsov-Ogievskiy wrote:
Minimal implementation of structured read: one data chunk + finishing
none chunk. No segmentation.
Minimal structured error implementation: no text message.
Support DF flag, but just ignore it, as there is no segmentation any
Might be worth adding that this is still an experimental extension to
the NBD spec, and therefore that this implementation serves as proof of
concept and may still need tweaking if anything major turns up before
promoting it to stable.  It might also be worth a link to:


Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
  include/block/nbd.h |  31 +++++++++++++
  nbd/nbd-internal.h  |   2 +
  nbd/server.c        | 125 ++++++++++++++++++++++++++++++++++++++++++++++++++--
  3 files changed, 154 insertions(+), 4 deletions(-)

diff --git a/include/block/nbd.h b/include/block/nbd.h
index 3c65cf8d87..58b864f145 100644
--- a/include/block/nbd.h
+++ b/include/block/nbd.h
@@ -70,6 +70,25 @@ struct NBDSimpleReply {
  typedef struct NBDSimpleReply NBDSimpleReply;
+typedef struct NBDStructuredReplyChunk {
+    uint32_t magic;
+    uint16_t flags;
+    uint16_t type;
+    uint64_t handle;
+    uint32_t length;
+} QEMU_PACKED NBDStructuredReplyChunk;
+typedef struct NBDStructuredRead {
+    NBDStructuredReplyChunk h;
+    uint64_t offset;
+} QEMU_PACKED NBDStructuredRead;
+typedef struct NBDStructuredError {
+    NBDStructuredReplyChunk h;
+    uint32_t error;
+    uint16_t message_length;
+} QEMU_PACKED NBDStructuredError;
Definitely a subset of all types added in the NBD protocol extension,
but reasonable for a minimal implementation.  Might be worth adding
comments to the types...

Hmm, for me their names looks descriptive enough, but my sight may be biased.. What kind of comments do you want?


Best regards,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]