The NBD protocol has now finalized the extension that fixes several shortcomings with NBD_OPT_EXPORT_NAME (namely, no error reporting, no way for the server to advertise block sizes to the client): https://github.com/NetworkBlockDevice/nbd/blob/extension-info/doc/proto.md
This sort of overlaps with the work Vladimir is proposing for implementing NBD_CMD_BLOCK_STATUS, but initial versions of these patches have been on the list for over a year now (see patches 37-44): https://lists.gnu.org/archive/html/qemu-devel/2016-04/msg03526.html v4 was here: https://lists.gnu.org/archive/html/qemu-devel/2017-02/msg04528.html Differences since then (if it is even worth comparing) include rebasing on top of Vladimir's cleanups and final tweaks to match the upstream NBD protocol that was finally promoted from experimental. Depends on my NBD staging tree (currently Vladimir's v3 nbd refactoring): http://repo.or.cz/qemu/ericb.git/shortlog/refs/heads/nbd https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg01805.html 001/9:[0047] [FC] 'nbd: Create struct for tracking export info' 002/9:[down] 'nbd: Don't bother tracing an NBD_OPT_ABORT response failure' 003/9:[0108] [FC] 'nbd: Expose and debug more NBD constants' 004/9:[down] 'nbd: Simplify trace of client flags in negotiation' 005/9:[down] 'nbd: Refactor reply to NBD_OPT_EXPORT_NAME' 006/9:[0146] [FC] 'nbd: Implement NBD_OPT_GO on server' 007/9:[0041] [FC] 'nbd: Implement NBD_OPT_GO on client' 008/9:[0014] [FC] 'nbd: Implement NBD_INFO_BLOCK_SIZE on server' 009/9:[0050] [FC] 'nbd: Implement NBD_INFO_BLOCK_SIZE on client' Eric Blake (9): nbd: Create struct for tracking export info nbd: Don't bother tracing an NBD_OPT_ABORT response failure nbd: Expose and debug more NBD constants nbd: Simplify trace of client flags in negotiation nbd: Refactor reply to NBD_OPT_EXPORT_NAME nbd: Implement NBD_OPT_GO on server nbd: Implement NBD_OPT_GO on client nbd: Implement NBD_INFO_BLOCK_SIZE on server nbd: Implement NBD_INFO_BLOCK_SIZE on client block/nbd-client.h | 3 +- include/block/nbd.h | 56 +++++++--- nbd/nbd-internal.h | 13 +-- block/nbd-client.c | 22 ++-- block/nbd.c | 16 ++- nbd/client.c | 283 ++++++++++++++++++++++++++++++++++++++++-------- nbd/common.c | 92 ++++++++++++++++ nbd/server.c | 304 ++++++++++++++++++++++++++++++++++++++++++++-------- qemu-nbd.c | 10 +- nbd/trace-events | 24 +++-- 10 files changed, 685 insertions(+), 138 deletions(-) -- 2.9.4