yoe/nbd — pull request #12 by reidrac (2013-01-26 13:19:45+00:00)
Title: Detect server disconnection after NBD_OPT_EXPORTNAME

If the export is unknown to the server, it may disconnect (new-style handshake un-fixed). In that case the read call to get export size may return 0 (non error, EOF).

This change fixes following error:

nbd-client -N unexistent 127.0.0.1 /dev/nbd0
Negotiation: ..size = 2314498962MBError: Exported device is too big for me. Get 64-bit machine :-(

Exiting.

Sorry about the previous pull request, I was in "Python" mode and I forgot the braces.