Skip to content
Snippets Groups Projects
  1. Sep 26, 2023
  2. Sep 25, 2023
    • Eric Blake's avatar
      nbd: Prepare for 64-bit request effect lengths · b2578459
      Eric Blake authored
      
      Widen the length field of NBDRequest to 64-bits, although we can
      assert that all current uses are still under 32 bits: either because
      of NBD_MAX_BUFFER_SIZE which is even smaller (and where size_t can
      still be appropriate, even on 32-bit platforms), or because nothing
      ever puts us into NBD_MODE_EXTENDED yet (and while future patches will
      allow larger transactions, the lengths in play here are still capped
      at 32-bit).  There are no semantic changes, other than a typo fix in a
      couple of error messages.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Message-ID: <20230829175826.377251-23-eblake@redhat.com>
      [eblake: fix assertion bug in nbd_co_send_simple_reply]
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
      b2578459
  3. Sep 22, 2023
    • Eric Blake's avatar
      nbd: Add types for extended headers · d95ffb6f
      Eric Blake authored
      
      Add the constants and structs necessary for later patches to start
      implementing the NBD_OPT_EXTENDED_HEADERS extension in both the client
      and server, matching recent upstream nbd.git (through commit
      e6f3b94a934).  This patch does not change any existing behavior, but
      merely sets the stage for upcoming patches.
      
      This patch does not change the status quo that neither the client nor
      server use a packed-struct representation for the request header.
      While most of the patch adds new types, there is also some churn for
      renaming the existing NBDExtent to NBDExtent32 to contrast it with
      NBDExtent64, which I thought was a nicer name than NBDExtentExt.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
      Message-ID: <20230829175826.377251-22-eblake@redhat.com>
      d95ffb6f
    • Eric Blake's avatar
      nbd/client: Pass mode through to nbd_send_request · 297365b4
      Eric Blake authored
      
      Once the 64-bit headers extension is enabled, the data layout we send
      over the wire for a client request depends on the mode negotiated with
      the server.  Rather than adding a parameter to nbd_send_request, we
      can add a member to struct NBDRequest, since it already does not
      reflect on-wire format.  Some callers initialize it directly; many
      others rely on a common initialization point during
      nbd_co_send_request().  At this point, there is no semantic change.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
      Message-ID: <20230829175826.377251-21-eblake@redhat.com>
      297365b4
    • Eric Blake's avatar
      nbd: Replace bool structured_reply with mode enum · ac132d05
      Eric Blake authored
      
      The upcoming patches for 64-bit extensions requires various points in
      the protocol to make decisions based on what was negotiated.  While we
      could easily add a 'bool extended_headers' alongside the existing
      'bool structured_reply', this does not scale well if more modes are
      added in the future.  Better is to expose the mode enum added in the
      recent commit bfe04d0a out to a wider use in the code base.
      
      Where the code previously checked for structured_reply being set or
      clear, it now prefers checking for an inequality; this works because
      the nodes are in a continuum of increasing abilities, and allows us to
      touch fewer places if we ever insert other modes in the middle of the
      enum.  There should be no semantic change in this patch.
      
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      Message-ID: <20230829175826.377251-20-eblake@redhat.com>
      Reviewed-by: default avatarVladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
      ac132d05
  4. Sep 21, 2023
  5. Sep 20, 2023
  6. Sep 08, 2023
Loading