[Libguestfs] [libnbd PATCH 0/7] state machine refactoring

Eric Blake eblake at redhat.com
Fri Jun 14 21:53:56 UTC 2019


I'm still playing with ideas on how to split rstate from wstate (so
that we can send a request without waiting for POLLIN to complete a
pending reply), but this is some preliminary refactoring I found
useful. I also fixed a couple of bugs while in the area (already
pushed).

There's a question of whether we want nbd_handle to be nearly 5k, or
if we should instead keep it small and add one more indirection where
sbuf is malloc'd; I'm not sure that it matters much (outside of
libnbd, nbd_handle is an opaque type always referenced as a pointer).

Eric Blake (7):
  states: Log structured error messages, if any
  states: Refactor SET_META_CONTEXT reply parsing
  states: Allow large SET_CONTEXT_NAME replies
  states: Rewrite NBD_REP_INFO parsing
  states: Factor out NBD_REP payload prep
  states: Give up on oversized reply length
  states: Capture NBD_REP_ERR message

 generator/generator                           | 19 ++--
 generator/states-newstyle-opt-go.c            | 71 ++++++-------
 .../states-newstyle-opt-set-meta-context.c    | 99 +++++++------------
 generator/states-newstyle-opt-starttls.c      | 39 ++------
 .../states-newstyle-opt-structured-reply.c    | 34 +++----
 generator/states-newstyle.c                   | 90 +++++++++++++++++
 generator/states-reply-structured.c           | 23 ++++-
 lib/internal.h                                |  4 +-
 8 files changed, 207 insertions(+), 172 deletions(-)

-- 
2.20.1




More information about the Libguestfs mailing list