search for: shut_writes

Displaying 4 results from an estimated 4 matches for "shut_writes".

2020 Mar 30
4
[libnbd PATCH 0/2] fix hangs against nbdkit 1.2
...dkit' and 'cd /path/to/nbdkit && /path/to/libnbd/run make check' will hang without this series. In short, this series is restoring the shutdown(SHUT_WR) call that got lost from plugins/nbd/nbd.c when nbdkit switched to libnbd in commit ab7760fc. Eric Blake (2): sockets: Add .shut_writes callback states: Add state for shutdown/gnutls_bye after NBD_CMD_DISC lib/internal.h | 4 +++- generator/state_machine.ml | 19 +++++++++++++++++-- generator/states-issue-command.c | 20 ++++++++++++++++++-- lib/crypto.c | 21 +++++++++++++++++---- l...
2020 Aug 14
0
[libnbd PATCH v2 06/13] api: Add nbd_opt_abort and nbd_aio_opt_abort
...SHUTDOWN); + } + return 0; + + NEWSTYLE.SEND_OPTION_SHUTDOWN: + /* We don't care if the server replies to NBD_OPT_ABORT. However, + * unless we are in opt mode, we want to preserve the error message + * from a failed OPT_GO by moving to DEAD instead. + */ + if (h->sock->ops->shut_writes (h, h->sock)) { + if (h->opt_mode) + SET_NEXT_STATE (%.CLOSED); + else + SET_NEXT_STATE (%.DEAD); + } + return 0; + NEWSTYLE.FINISHED: SET_NEXT_STATE (%.READY); return 0; diff --git a/lib/opt.c b/lib/opt.c index 306a2e9..6243553 100644 --- a/lib/opt.c +++ b/lib/opt.c...
2020 Aug 11
3
[libnbd PATCH] API: Add nbd_set_opt_mode to expose NEGOTIATING state
...>opt_mode); + switch (send_from_wbuf (h)) { + case -1: SET_NEXT_STATE (%.DEAD); return 0; + case 0: + SET_NEXT_STATE (%SEND_OPTION_SHUTDOWN); + } + return 0; + + NEWSTYLE.SEND_OPTION_SHUTDOWN: + /* We don't care if the server replies to NBD_OPT_ABORT */ + if (h->sock->ops->shut_writes (h, h->sock)) + SET_NEXT_STATE (%.CLOSED); + return 0; + NEWSTYLE.FINISHED: - if ((h->gflags & LIBNBD_HANDSHAKE_FLAG_FIXED_NEWSTYLE) == 0) - h->protocol = "newstyle"; - else - h->protocol = "newstyle-fixed"; - SET_NEXT_STATE (%.READY); return...
2020 Aug 14
18
[libnbd PATCH v2 00/13] Adding nbd_set_opt_mode to improve nbdinfo
Well, I'm not quite done (I still want to get nbdinfo to work on a single nbd connection for all cases when reading the heads of the file is not required), but I'm happy with patches 1-11, and 12-13 show where I'm headed for getting NBD_OPT_INFO to work. Posting now to see if some of the earlier patches are ready to commit while I continue working on the latter half. Eric Blake (13):