nbd: Minimal structured read for client

Minimal implementation: for structured error only error_report error
message.

Note that test 83 is now more verbose, because the implementation
prints more warnings about unexpected communication errors; perhaps
future patches should tone things down by using trace messages
instead of traces, but the common case of successful communication
is no noisier than before.

Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20171027104037.8319-13-eblake@redhat.com>
This commit is contained in:
Vladimir Sementsov-Ogievskiy 2017-10-27 12:40:37 +02:00 committed by Eric Blake
parent 56dc682bf5
commit f140e30003
6 changed files with 502 additions and 37 deletions

View file

@ -41,6 +41,7 @@ can't open device nbd+tcp://127.0.0.1:PORT/foo
=== Check disconnect after neg2 ===
Connection closed
read failed: Input/output error
=== Check disconnect 8 neg2 ===
@ -53,32 +54,39 @@ can't open device nbd+tcp://127.0.0.1:PORT/foo
=== Check disconnect before request ===
Connection closed
read failed: Input/output error
=== Check disconnect after request ===
Connection closed
read failed: Input/output error
=== Check disconnect before reply ===
Connection closed
read failed: Input/output error
=== Check disconnect after reply ===
Unexpected end-of-file before all bytes were read
read failed: Input/output error
=== Check disconnect 4 reply ===
Unexpected end-of-file before all bytes were read
Connection closed
read failed: Input/output error
=== Check disconnect 8 reply ===
Unexpected end-of-file before all bytes were read
Connection closed
read failed: Input/output error
=== Check disconnect before data ===
Unexpected end-of-file before all bytes were read
read failed: Input/output error
=== Check disconnect after data ===
@ -108,6 +116,7 @@ can't open device nbd+tcp://127.0.0.1:PORT/
=== Check disconnect after neg-classic ===
Connection closed
read failed: Input/output error
=== Check disconnect before neg1 ===
@ -168,28 +177,34 @@ read failed: Input/output error
=== Check disconnect after request ===
Connection closed
read failed: Input/output error
=== Check disconnect before reply ===
Connection closed
read failed: Input/output error
=== Check disconnect after reply ===
Unexpected end-of-file before all bytes were read
read failed: Input/output error
=== Check disconnect 4 reply ===
Unexpected end-of-file before all bytes were read
Connection closed
read failed: Input/output error
=== Check disconnect 8 reply ===
Unexpected end-of-file before all bytes were read
Connection closed
read failed: Input/output error
=== Check disconnect before data ===
Unexpected end-of-file before all bytes were read
read failed: Input/output error
=== Check disconnect after data ===