nbd: Add exports listing support
PATCH 1/2 nbd: Handle fixed new-style clients.
In reply to Hani BenhabilesWhen this flag is set, the server tells the client that it can send another option if the server received a request with an option that it doesn't understand instead of directly closing the connection.
Also add link to the most up-to-date documentation.
--- include/block/nbd.h | 9 ++++ nbd.c | 143 ++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 109 insertions(+), 43 deletions(-)
include/block/nbd.h +9 -0
@@ -45,6 +45,15 @@ struct nbd_reply {#define NBD_FLAG_ROTATIONAL (1 << 4)/* Use elevator algorithm - rotational media */ #define NBD_FLAG_SEND_TRIM (1 << 5)/* Send TRIM (discard) */ +/* New-style global flags. */ +#define NBD_FLAG_FIXED_NEWSTYLE (1 << 0)/* Fixed newstyle protocol. */ + +/* New-style client flags. */ +#define NBD_FLAG_C_FIXED_NEWSTYLE (1 << 0)/* Fixed newstyle protocol. */ + +/* Reply types. */ +#define NBD_REP_ERR_UNSUP ((1 << 31) | 1)/* Unknown option. */ +#define NBD_CMD_MASK_COMMAND 0x0000ffff#define NBD_CMD_FLAG_FUA (1 << 16)
nbd.c +100 -43
205 lines not on this page · raw message
Signature · 1 line
1.8.3.2
PATCH 2/2 nbd: Handle NBD_OPT_LIST option.
In reply to Hani Benhabiles--- include/block/nbd.h | 2 ++ nbd.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+)
include/block/nbd.h +2 -0
@@ -52,6 +52,8 @@ struct nbd_reply {#define NBD_FLAG_C_FIXED_NEWSTYLE (1 << 0)/* Fixed newstyle protocol. */ /* Reply types. */ +#define NBD_REP_ACK (1)/* Data sending finished. */ +#define NBD_REP_SERVER (2)/* Export description. */ #define NBD_REP_ERR_UNSUP ((1 << 31) | 1)/* Unknown option. */ #define NBD_CMD_MASK_COMMAND 0x0000ffff
nbd.c +61 -0
79 lines not on this page · raw message
Signature · 1 line
1.8.3.2
cover nbd: Add exports listing support
Compared to v2:
* 1/2: Handle options in loop. Handle NBD_OPT_ABORT. Add link to documentation. Improve commit message.
* 2/2: Fix return value in NBD_OPT_LIST case. Rename nbd_send_list() function to nbd_handle_list().
* Remove patch 3/3 from v2. Applied separately by Paolo.
Hani Benhabiles (2):
nbd: Handle fixed new-style clients.
nbd: Handle NBD_OPT_LIST option.
include/block/nbd.h | 11 +++ nbd.c | 200 +++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 170 insertions(+), 41 deletions(-)
Signature · 1 line
1.8.3.2
Paolo Bonzini
AppliedIl 07/06/2014 02:32, Hani Benhabiles ha scritto:
Quoted 7 lines
Compared to v2:
* 1/2: Handle options in loop. HandleNBD_OPT_ABORT. Add link to documentation. Improve commit message.
* 2/2: Fix return value inNBD_OPT_LISTcase. Renamenbd_send_list()function tonbd_handle_list().
* Remove patch 3/3 from v2. Applied separately by Paolo.
Quoted 8 lines
Hani Benhabiles (2):
nbd: Handle fixed new-style clients.
nbd: HandleNBD_OPT_LISToption.include/block/nbd.h | 11 +++ nbd.c | 200 +++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 170 insertions(+), 41 deletions(-)
Applied, thanks!
Paolo