On 9 Apr 2016, at 22:12, Eric Blake <eblake@...696...> wrote: >> Disconnection >> ============= >> >> Client side >> ----------- >> >> Where the client wishes to disconnect safely, it MUST follow the following >> procedure: >> >> * First it must wait until there are no inflight commands, i.e. every >> request that it has sent has been replied to. From this point onwards >> it MUST NOT send further commands. >> >> * Second, if the flag NBD_FLAG_SEND_FLUSH is set, it must sent a >> NBD_CMD_FLUSH command, and wait for the reply. >> >> * At this point it closes the TCP session. > > And I think qemu already complies with this. (apologies for the 2 messages) I'm suggesting we don't send NBD_CMD_DISC at all. Qemu certainly tries to send NBD_CMD_DISC. It just doesn't always get there (over TLS) - possibly because of lack of a gnutls_bye(). I'm suggesting we simply document as safe disconnections without NBD_CMD_DISC provided the above procedure has been gone through. And to use NBD_CMD_DISC you should go through the procedure too. That makes NBD_CMD_DISC a bit pointless, as you can equally well just disconnect. -- Alex Bligh
Attachment:
signature.asc
Description: Message signed with OpenPGP using GPGMail